From: Jean Privat Date: Fri, 28 Aug 2009 17:00:02 +0000 (-0400) Subject: gc: show default GC on warnings X-Git-Tag: v0.3~3 X-Git-Url: http://nitlanguage.org gc: show default GC on warnings Signed-off-by: Jean Privat --- diff --git a/c_src/clib/nit_main.c b/c_src/clib/nit_main.c index b578658..e7ad4e9 100644 --- a/c_src/clib/nit_main.c +++ b/c_src/clib/nit_main.c @@ -79,10 +79,13 @@ void exithandler(int s) { } void initialize_gc_option(void) { /* GC default */ + char *def; #ifdef WITH_LIBGC gc_option = boehm; + def = "boehm"; #else gc_option = nitgc; + def = "nitgc"; #endif /* Process GC runtime selection */ @@ -92,14 +95,14 @@ void initialize_gc_option(void) { #ifdef WITH_LIBGC gc_option = boehm; #else - fprintf(stderr, "Compiled without Boehm GC support. Using default.\n"); + fprintf(stderr, "Compiled without Boehm GC support. Using default '%s'.\n", def); #endif } else if (strcmp(opt, "nitgc")==0) { gc_option = nitgc; } else if (strcmp(opt, "large")==0) { gc_option = large; } else { - fprintf(stderr, "Invalid GC option in NIT_GC_OPTION environment variable. Using default.\n"); + fprintf(stderr, "Invalid GC option in NIT_GC_OPTION environment variable. Using default '%s'.\n", def); } } diff --git a/clib/nit_main.c b/clib/nit_main.c index b578658..e7ad4e9 100644 --- a/clib/nit_main.c +++ b/clib/nit_main.c @@ -79,10 +79,13 @@ void exithandler(int s) { } void initialize_gc_option(void) { /* GC default */ + char *def; #ifdef WITH_LIBGC gc_option = boehm; + def = "boehm"; #else gc_option = nitgc; + def = "nitgc"; #endif /* Process GC runtime selection */ @@ -92,14 +95,14 @@ void initialize_gc_option(void) { #ifdef WITH_LIBGC gc_option = boehm; #else - fprintf(stderr, "Compiled without Boehm GC support. Using default.\n"); + fprintf(stderr, "Compiled without Boehm GC support. Using default '%s'.\n", def); #endif } else if (strcmp(opt, "nitgc")==0) { gc_option = nitgc; } else if (strcmp(opt, "large")==0) { gc_option = large; } else { - fprintf(stderr, "Invalid GC option in NIT_GC_OPTION environment variable. Using default.\n"); + fprintf(stderr, "Invalid GC option in NIT_GC_OPTION environment variable. Using default '%s'.\n", def); } }