* alloc.c [CPPCHECK] (GC_compute_heap_usage_percent): Replace
GC_WORD_MAX/100 with (GC_WORD_MAX>>1)/50; add comment.
* os_dep.c [!AMIGA && !HAIKU && !OPENBSD && !OS2 && !MSWIN32]
(GC_get_main_stack_base): Skip assertion on result if CPPCHECK.
{
word used = GC_composite_in_use + GC_atomic_in_use;
word heap_sz = GC_heapsize - GC_unmapped_bytes;
- return used >= heap_sz ? 0 : used < GC_WORD_MAX / 100 ?
+# if defined(CPPCHECK)
+ word limit = (GC_WORD_MAX >> 1) / 50; /* to avoid a false positive */
+# else
+ const word limit = GC_WORD_MAX / 100;
+# endif
+
+ return used >= heap_sz ? 0 : used < limit ?
(int)((used * 100) / heap_sz) : (int)(used / (heap_sz / 100));
}
result = (ptr_t)(signed_word)(-sizeof(ptr_t));
# endif
# endif
- GC_ASSERT((word)GC_approx_sp() HOTTER_THAN (word)result);
+# if !defined(CPPCHECK)
+ GC_ASSERT((word)GC_approx_sp() HOTTER_THAN (word)result);
+# endif
return(result);
}
# define GET_MAIN_STACKBASE_SPECIAL