]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
More compile warnings (disabled many for now, they will be re-enabled one-by-one...
authorDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 14:57:48 +0000 (10:57 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 14:57:48 +0000 (10:57 -0400)
Makefile
lex.c
main.c

index 7c332105fe06e7ca708a981af3f930834cf11ac7..a4216a54546c4a7c519bf3de1d36fcfc0080497e 100644 (file)
--- 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 a7949eaf092c8fa212831055d5b65315df665a9b..54875a35a1314d1459157236a9cb5d416e481410 100644 (file)
--- 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 919106000ce63bb41d4069c3f74a795f3aab4ff7..fe2f42690cde09083e524071ffe9490c8f5966ff 100644 (file)
--- 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; }