]> granicus.if.org Git - gc/commitdiff
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>
Thu, 6 Apr 2017 07:34:16 +0000 (10:34 +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 796ed4734a841a92129033a64a739d71b95eb123..4867fdee3d8b5ad4cb9a9cf676dcbe6d12dac230 100644 (file)
@@ -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; \