From: Jean Privat Date: Sun, 25 Jan 2009 05:03:24 +0000 (-0500) Subject: Show gcc warnings. X-Git-Url: http://nitlanguage.org?ds=sidebyside Show gcc warnings. Also remove some trivial warnings. --- diff --git a/bin/gccx b/bin/gccx index 93a0009..8da5452 100755 --- 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;; diff --git a/lib/nit_main.c b/lib/nit_main.c index 1b181c6..86ddd7c 100644 --- a/lib/nit_main.c +++ b/lib/nit_main.c @@ -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); diff --git a/src/compiling/compiling_methods.nit b/src/compiling/compiling_methods.nit index 2729ea1..63f6bfa 100644 --- a/src/compiling/compiling_methods.nit +++ b/src/compiling/compiling_methods.nit @@ -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