diff --git a/Makefile b/Makefile index 63cad7a27e..93fd4cbf63 100644 --- a/Makefile +++ b/Makefile @@ -48,7 +48,8 @@ CFLAGS := -Os -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ -ffreestanding -fno-builtin HOSTCC := gcc -HOSTCFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +HOSTCFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer \ + -Wno-unused -Wno-sign-compare -Wno-pointer-sign LINUXBIOSINCLUDE := -I$(src) -Iinclude \ -I$(src)/include \ diff --git a/util/dtc/Makefile b/util/dtc/Makefile index 34dfb3fe46..dcddf4cd47 100644 --- a/util/dtc/Makefile +++ b/util/dtc/Makefile @@ -28,9 +28,9 @@ $(obj)/lex.yy.c: $(src)/util/dtc/dtc-lexer.l $(obj)/dtc.o: $(src)/util/dtc/dtc.c $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< $(obj)/livetree.o: $(src)/util/dtc/livetree.c - $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< + $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< $(obj)/flattree.o: $(src)/util/dtc/flattree.c - $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< + $(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< $(obj)/data.o: $(src)/util/dtc/data.c $(Q)$(HOSTCC) $(HOSTCFLAGS) -o $@ -c $< $(obj)/treesource.o: $(src)/util/dtc/treesource.c diff --git a/util/dtc/data.c b/util/dtc/data.c index d3b55f9ffe..1389710aea 100644 --- a/util/dtc/data.c +++ b/util/dtc/data.c @@ -128,7 +128,7 @@ struct data data_copy_escape_string(char *s, int len) { int i = 0; struct data d; - char *q; + unsigned char *q; d = data_grow_for(empty_data, strlen(s)+1); diff --git a/util/dtc/dtc-lexer.l b/util/dtc/dtc-lexer.l index 0778af0c88..239e4ccafb 100644 --- a/util/dtc/dtc-lexer.l +++ b/util/dtc/dtc-lexer.l @@ -84,7 +84,7 @@ char *code = 0; [0-9a-fA-F]+ { yylloc.first_line = yylineno; - if (yyleng > 2*sizeof(yylval.addr)) { + if ((unsigned long)yyleng > 2*sizeof(yylval.addr)) { fprintf(stderr, "Address value %s too large\n", yytext); } @@ -103,7 +103,7 @@ char *code = 0; [0-9a-fA-F]+ { yylloc.first_line = yylineno; - if (yyleng > 2*sizeof(yylval.cval)) { + if ((unsigned long)yyleng > 2*sizeof(yylval.cval)) { fprintf(stderr, "Cell value %s too long\n", yytext); } diff --git a/util/dtc/dtc.c b/util/dtc/dtc.c index d11282a3c9..ec172064d4 100644 --- a/util/dtc/dtc.c +++ b/util/dtc/dtc.c @@ -105,12 +105,12 @@ static void usage(void) int main(int argc, char *argv[]) { - struct boot_info *bi; + struct boot_info *bi=NULL; char *inform = "dts"; char *outform = "dts"; char *outname = "-"; int force = 0; - char *arg; + char *arg=NULL; int opt; FILE *inf = NULL; FILE *outf = NULL; diff --git a/util/dtc/flattree.c b/util/dtc/flattree.c index 2174b85223..7bcce8dbac 100644 --- a/util/dtc/flattree.c +++ b/util/dtc/flattree.c @@ -465,6 +465,7 @@ static void linuxbios_emit_endnode(void *e, char *label) } } +#ifdef LINUXBIOS_OUTPUT static void linuxbios_emit_struct_start(void *e, char *prefix, char *label) { FILE *f = e; @@ -482,7 +483,7 @@ static void linuxbios_emit_struct_end(void *e, char *prefix, char *label) fprintf(f, "}; /*%s*/\n", label); } } - +#endif static void linuxbios_emit_property(void *e, char *label) @@ -1293,7 +1294,7 @@ static const char UNITCHAR[] = "0123456789abcdef,"; static int check_node_name(char *name) { char *atpos; - int basenamelen; + unsigned int basenamelen; atpos = strrchr(name, '@'); @@ -1374,7 +1375,7 @@ static struct node *unflatten_tree(struct inbuf *dtbuf, struct boot_info *dt_from_blob(FILE *f) { - u32 magic, totalsize, version, size_str; + u32 magic, totalsize, version, size_str = 0; u32 off_dt, off_str, off_mem_rsvmap; int rc; char *blob; diff --git a/util/dtc/treesource.c b/util/dtc/treesource.c index e9bbaa51bb..5b464c6008 100644 --- a/util/dtc/treesource.c +++ b/util/dtc/treesource.c @@ -57,7 +57,7 @@ enum proptype { static enum proptype guess_type(struct property *prop) { int len = prop->val.len; - char *p = prop->val.val; + unsigned char *p = prop->val.val; int nnoprint = 0; int i; @@ -92,7 +92,7 @@ static void write_tree_source_node(FILE *f, struct node *tree, int level) for_each_property(tree, prop) { cell_t *cp; - char *bp; + unsigned char *bp; void *propend; enum proptype type; diff --git a/util/lar/Makefile b/util/lar/Makefile index fba1c9da15..d65fc92d2c 100644 --- a/util/lar/Makefile +++ b/util/lar/Makefile @@ -20,10 +20,6 @@ SOURCE := lar.c create.c extract.c list.c lib.c - -HOSTCC=gcc -HOSTCFLAGS=-O2 -Wall -W - $(obj)/util/lar/lar: $(patsubst %,$(src)/util/lar/%,$(SOURCE)) $(Q)printf "Building LAR utility..." $(Q)mkdir -p $(obj)/util/lar