]> granicus.if.org Git - gc/commitdiff
Eliminate 'scope of variable can be reduced' warning in write_fault_handler
authorIvan Maidanski <ivmai@mail.ru>
Wed, 19 Oct 2016 08:42:24 +0000 (11:42 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 19 Oct 2016 08:42:40 +0000 (11:42 +0300)
* os_dep.c [!DARWIN] (GC_write_fault_handler): Move "i" local variable
declaration to the inner scope where the variable is actually used.

os_dep.c

index 315d33fbfeb72cb2b978cd61c0968a32e3ef9b00..e64df6f20597552bbce2892221702809e00f85fd 100644 (file)
--- a/os_dep.c
+++ b/os_dep.c
@@ -3166,16 +3166,16 @@ GC_API GC_push_other_roots_proc GC_CALL GC_get_push_other_roots(void)
         char * addr = (char *) (exc_info -> ExceptionRecord
                                 -> ExceptionInformation[1]);
 #   endif
-    size_t i;
 
     if (SIG_OK && CODE_OK) {
         register struct hblk * h =
                         (struct hblk *)((word)addr & ~(GC_page_size-1));
         GC_bool in_allocd_block;
+        size_t i;
+
 #       ifdef CHECKSUMS
           GC_record_fault(h);
 #       endif
-
 #       ifdef SUNOS5SIGS
             /* Address is only within the correct physical page.        */
             in_allocd_block = FALSE;