From: Ivan Maidanski Date: Thu, 30 May 2019 06:17:54 +0000 (+0300) Subject: Workaround 'checking if unsigned i < 0' cppcheck FP in is_heap_base X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8434e72b46e66ce23103a33c450f4e9507d8c23b;p=gc Workaround 'checking if unsigned i < 0' cppcheck FP in is_heap_base * os_dep.c [MSWIN32 || MSWINCE || CYGWIN32] (GC_is_heap_base): Change type for i local variable from unsigned to int; cast GC_n_heap_bases to int. --- diff --git a/os_dep.c b/os_dep.c index 224c5da8..27afee1c 100644 --- a/os_dep.c +++ b/os_dep.c @@ -1853,14 +1853,14 @@ void GC_register_data_segments(void) /* heap sections? */ GC_INNER GC_bool GC_is_heap_base(void *p) { - unsigned i; + int i; # ifndef REDIRECT_MALLOC if (GC_root_size > GC_max_root_size) GC_max_root_size = GC_root_size; # ifdef USE_WINALLOC if (GC_is_malloc_heap_base(p)) return TRUE; # endif # endif - for (i = 0; i < GC_n_heap_bases; i++) { + for (i = 0; i < (int)GC_n_heap_bases; i++) { if (GC_heap_bases[i] == p) return TRUE; } return FALSE;