From: Ivan Maidanski Date: Mon, 13 Mar 2017 21:31:08 +0000 (+0300) Subject: Fix 'ISO C90 forbids mixed declarations/code' compiler warning (gc_pmark) X-Git-Tag: v7.6.2~232 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65af16e4d6cd12a0a0e09cb2502bf35675179fda;p=gc 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). --- diff --git a/include/private/gc_pmark.h b/include/private/gc_pmark.h index 796ed473..4867fdee 100644 --- a/include/private/gc_pmark.h +++ b/include/private/gc_pmark.h @@ -316,9 +316,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); \ goto exit_label; \