From ff2fac613ffd499c7424fb57ae7f1dadf7329c5f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Sat, 14 Jun 2014 19:55:15 +0400 Subject: [PATCH] Fix 'variable unused' warning in GC_save_callers * os_dep.c (GC_save_callers): Do not declare "i" local variable unless it is used. --- os_dep.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/os_dep.c b/os_dep.c index bbae09e8..c437ff19 100644 --- a/os_dep.c +++ b/os_dep.c @@ -4589,8 +4589,10 @@ GC_INNER void GC_save_callers(struct callinfo info[NFRAMES]) for (; !((word)fp HOTTER_THAN (word)frame) && !((word)GC_stackbottom HOTTER_THAN (word)fp) && nframes < NFRAMES; - fp = (struct frame *)((long) fp -> FR_SAVFP + BIAS), nframes++) { - register int i; + fp = (struct frame *)((long) fp -> FR_SAVFP + BIAS), nframes++) { +# if NARGS > 0 + register int i; +# endif info[nframes].ci_pc = fp->FR_SAVPC; # if NARGS > 0 -- 2.40.0