Also remove some trivial warnings.
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
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;;
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);
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
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