From 09abf8af0d2d3547521881267a011e35b302b232 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 14 Mar 2017 00:31:08 +0300 Subject: [PATCH] Fix 'ISO C90 forbids mixed declarations/code' compiler warning (gc_pmark) * include/private/gc_pmark.h [MARK_BIT_PER_OBJ] (PUSH_CONTENTS_HDR): Declare "obj_displ" local variable at the beginning of the block (not after GC_STATIC_ASSERT). --- include/private/gc_pmark.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/private/gc_pmark.h b/include/private/gc_pmark.h index 282672a..5077264 100644 --- a/include/private/gc_pmark.h +++ b/include/private/gc_pmark.h @@ -313,9 +313,10 @@ GC_INNER mse * GC_signal_mark_stack_overflow(mse *msp); hhdr -> hb_block == HBLKPTR(current)); \ GC_ASSERT((word)hhdr->hb_block < (word)(current)); \ } else { \ + size_t obj_displ; \ /* Accurate enough if HBLKSIZE <= 2**15. */ \ GC_STATIC_ASSERT(HBLKSIZE <= (1 << 15)); \ - size_t obj_displ = (((low_prod >> 16) + 1) * (hhdr->hb_sz)) >> 16; \ + obj_displ = (((low_prod >> 16) + 1) * hhdr->hb_sz) >> 16; \ if (do_offset_check && !GC_valid_offsets[obj_displ]) { \ GC_ADD_TO_BLACK_LIST_NORMAL(current, source); \ break; \ -- 2.7.4