From: Ivan Maidanski Date: Sun, 9 Sep 2012 07:15:48 +0000 (+0400) Subject: Replace var-args GC_noop with fixed-args one X-Git-Tag: gc7_4_0~218 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3e9fa7e2e86241629781fa595eeb215177b263a9;p=gc Replace var-args GC_noop with fixed-args one (to suppress Clang warning that arguments were dropped) * alloc.c (GC_stopped_mark, GC_try_to_collect_general): Use GC_noop6 instead of var-args GC_noop. * include/private/gc_priv.h (GC_noop): Replace var-args (and platform-specific) prototype with GC_noop6 one. * mark.c (GC_noop): Replace with GC_noop6 (with all arguments ignored); refine comment. --- diff --git a/alloc.c b/alloc.c index fdb515ba..28d78e44 100644 --- a/alloc.c +++ b/alloc.c @@ -627,7 +627,8 @@ STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func) /* Mark from all roots. */ /* Minimize junk left in my registers and on the stack */ GC_clear_a_few_frames(); - GC_noop(0,0,0,0,0,0); + GC_noop6(0,0,0,0,0,0); + GC_initiate_gc(); for (i = 0;;i++) { if ((*stop_func)()) { @@ -985,7 +986,7 @@ STATIC GC_bool GC_try_to_collect_general(GC_stop_func stop_func, # endif ENTER_GC(); /* Minimize junk left in my registers */ - GC_noop(0,0,0,0,0,0); + GC_noop6(0,0,0,0,0,0); result = GC_try_to_collect_inner(stop_func != 0 ? stop_func : GC_default_stop_func); EXIT_GC(); diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 6458bda6..823e2c5f 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -1993,15 +1993,7 @@ extern word GC_fo_entries; /* should be visible in extra/MacOS.c */ #endif /* Make arguments appear live to compiler */ -#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__CC_ARM) - void GC_noop(void*, ...); -#else -# ifdef __DMC__ - void GC_noop(...); -# else - void GC_noop(); -# endif -#endif +void GC_noop6(word, word, word, word, word, word); GC_API void GC_CALL GC_noop1(word); diff --git a/mark.c b/mark.c index 29ee3f01..50be939a 100644 --- a/mark.c +++ b/mark.c @@ -22,17 +22,14 @@ # include #endif -/* We put this here to minimize the risk of inlining. */ -/*VARARGS*/ -#if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__CC_ARM) - void GC_noop(void * p GC_ATTR_UNUSED, ...) {} -#else -# ifdef __DMC__ - void GC_noop(...) {} -# else - void GC_noop() {} -# endif -#endif +/* Make arguments appear live to compiler. Put here to minimize the */ +/* risk of inlining. Used to minimize junk left in registers. */ +void GC_noop6(word arg1 GC_ATTR_UNUSED, word arg2 GC_ATTR_UNUSED, + word arg3 GC_ATTR_UNUSED, word arg4 GC_ATTR_UNUSED, + word arg5 GC_ATTR_UNUSED, word arg6 GC_ATTR_UNUSED) +{ + /* Empty */ +} /* Single argument version, robust against whole program analysis. */ volatile word GC_noop_sink;