Fix 'ISO C90 forbids mixed declarations/code' compiler warning (gc_pmark)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 13 Mar 2017 21:31:08 +0000 (00:31 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 13 Mar 2017 21:31:08 +0000 (00:31 +0300)
* 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

index 282672a..5077264 100644 (file)
@@ -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; \