Workaround 'same expression on both sides of ==' cppcheck style warning
authorIvan Maidanski <ivmai@mail.ru>
Tue, 18 Oct 2016 10:34:34 +0000 (13:34 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 18 Oct 2016 10:34:34 +0000 (13:34 +0300)
* misc.c (GC_init): Do not check sizeof(signed_word) value if CPPCHECK.

misc.c

diff --git a/misc.c b/misc.c
index e57d000..33131bd 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1184,7 +1184,9 @@ GC_API void GC_CALL GC_init(void)
       }
 #   endif
     GC_STATIC_ASSERT(sizeof (ptr_t) == sizeof(word));
-    GC_STATIC_ASSERT(sizeof (signed_word) == sizeof(word));
+#   if !defined(CPPCHECK)
+      GC_STATIC_ASSERT(sizeof(signed_word) == sizeof(word));
+#   endif
     GC_STATIC_ASSERT(sizeof (struct hblk) == HBLKSIZE);
 #   ifndef THREADS
       GC_ASSERT(!((word)GC_stackbottom HOTTER_THAN (word)GC_approx_sp()));