From 84c110e8f584d0be591a974eabdb3056a90066dc Mon Sep 17 00:00:00 2001 From: Dale Weiler Date: Thu, 7 Jun 2012 10:57:48 -0400 Subject: [PATCH] More compile warnings (disabled many for now, they will be re-enabled one-by-one as code that triggers warnings is rectified) --- Makefile | 26 +++++++++++++++++++++++++- lex.c | 1 - main.c | 1 - 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7c33210..a4216a5 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,27 @@ CC ?= clang -CFLAGS += -Wall -I. -pedantic-errors -std=c90 -Wno-attributes +CFLAGS += -Wall -I. -pedantic-errors -std=c90 + +#turn on tons of warnings if clang is present +ifeq ($(CC), clang) + CFLAGS += \ + -Weverything \ + -Wno-missing-prototypes \ + -Wno-unused-parameter \ + -Wno-sign-compare \ + -Wno-implicit-fallthrough \ + -Wno-sign-conversion \ + -Wno-conversion \ + -Wno-disabled-macro-expansion \ + -Wno-padded \ + -Wno-undef \ + -Wno-conditional-uninitialized \ + -Wno-missing-noreturn \ + -Wno-ignored-qualifiers \ + -Wno-unused-macros \ + -Wno-format-nonliteral \ + -Wno-shadow + +endif OBJ = lex.o \ error.o \ parse.o \ @@ -34,3 +56,5 @@ all: test gmqcc clean: rm -f *.o gmqcc test_ast test_ir test/*.o + + diff --git a/lex.c b/lex.c index a7949ea..54875a3 100644 --- a/lex.c +++ b/lex.c @@ -124,7 +124,6 @@ static int lex_trigraph(lex_file *file) { default: lex_unget('?', file); lex_unget(ch , file); - return '?'; } return '?'; } diff --git a/main.c b/main.c index 9191060..fe2f426 100644 --- a/main.c +++ b/main.c @@ -105,7 +105,6 @@ int main(int argc, char **argv) { if (util_strncmpexact(&argv[1][1], "memchk", 6)) { opts_memchk = true; break; } if (util_strncmpexact(&argv[1][1], "help", 4)) { return usage(app); - break; } /* compiler type selection */ if (util_strncmpexact(&argv[1][1], "std=qcc" , 7 )) { opts_compiler = COMPILER_QCC; break; } -- 2.39.2