Show gcc warnings.
authorJean Privat <jean@pryen.org>
Sun, 25 Jan 2009 05:03:24 +0000 (00:03 -0500)
committerJean Privat <jean@pryen.org>
Sun, 25 Jan 2009 05:03:24 +0000 (00:03 -0500)
Also remove some trivial warnings.

bin/gccx
lib/nit_main.c
src/compiling/compiling_methods.nit

index 93a0009..8da5452 100755 (executable)
--- a/bin/gccx
+++ b/bin/gccx
@@ -19,7 +19,7 @@
 
 OPTS="-g" # option for compiler call
 objs="" # List of .o files
-CC="gcc --ansi --pedantic" # Default compiler call
+CC="gcc --ansi --pedantic -Wall -Wextra -Wformat-security -Wcast-align -Wno-uninitialized -Wno-unused-variable -Wno-unused-label -Wno-unused-parameter" # Default compiler call
 ext="_savo _sav" # Default flavor to reuse
 out="a.out"  # Default output binary filename
 dir="" # Default tmp dir
@@ -64,7 +64,7 @@ return $res
 stop=false
 while [ $stop = false ]; do
        case $1 in 
-               -O) CC="gcc --ansi --pedantic -O2" ext="_savo"; shift;;
+               -O) OPTS="$OPTS -O2" ext="_savo"; shift;;
                -i) CC="/opt/intel/cc/10.1.015/bin/icc -O2" ext="_savi"; shift;;
                -I) OPTS="$OPTS -I $2"; shift; shift;;
                -o) out="$2"; shift; shift;;
index 1b181c6..86ddd7c 100644 (file)
@@ -42,7 +42,9 @@ void exithandler(int s) {
 void prepare_signals(void) {
 #if WITH_LIBGC
        nolibgc = (getenv("NIT_NOLIBGC") != NULL);
-       if (!nolibgc) GC_INIT();
+       if (!nolibgc) {
+               GC_INIT();
+       }
 #endif
        signal(SIGINT,exithandler);
        signal(SIGABRT,exithandler);
index 2729ea1..63f6bfa 100644 (file)
@@ -526,7 +526,7 @@ end
 redef class ADeferredMethPropdef
        redef meth do_compile_inside(v, method, params)
        do
-               v.add_instr("fprintf(stderr, \"Deferred method %s called\");")
+               v.add_instr("fprintf(stderr, \"Deferred method called\");")
                v.add_instr(v.printf_locate_error(self))
                v.add_instr("nit_exit(1);")
                if method.signature.return_type != null then
@@ -576,7 +576,7 @@ redef class AInternMethPropdef
                        else if n == once "unary -".to_symbol then
                                s = "TAG_Int(-UNTAG_Int({p[0]}))"
                        else if n == once "output".to_symbol then
-                               v.add_instr("printf(\"%d\\n\", UNTAG_Int({p[0]}));")
+                               v.add_instr("printf(\"%ld\\n\", UNTAG_Int({p[0]}));")
                        else if n == once "ascii".to_symbol then
                                s = "TAG_Char(UNTAG_Int({p[0]}))"
                        else if n == once "succ".to_symbol then