From f47b4ee529d1ed8c2f04014ea847343d41b93e2d Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 28 Dec 2015 17:49:54 +0300 Subject: [PATCH] Workaround 'comparison is always false' GCC warning in GC_FAST_MALLOC_GRANS * include/gc_inline.h (GC_FAST_MALLOC_GRANS): Refactoring of condition expression for entry containing counter or is NULL to avoid "comparison of unsigned expression < 0 is always false" warning reported by GCC. --- include/gc_inline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/gc_inline.h b/include/gc_inline.h index 8d93f44a..90a7a761 100644 --- a/include/gc_inline.h +++ b/include/gc_inline.h @@ -79,7 +79,7 @@ GC_API void GC_CALL GC_generic_malloc_many(size_t /* lb */, int /* k */, while (GC_EXPECT((GC_word)my_entry \ <= (num_direct) + GC_TINY_FREELISTS + 1, 0)) { \ /* Entry contains counter or NULL */ \ - if ((GC_word)my_entry - 1 < (num_direct)) { \ + if ((GC_word)my_entry <= (num_direct) && my_entry != 0) { \ /* Small counter value, not NULL */ \ *my_fl = (char *)my_entry + (granules) + 1; \ result = (default_expr); \ -- 2.49.0