Workaround 'shifting 32-bit value by 32 bits undefined' cppcheck warning
authorIvan Maidanski <ivmai@mail.ru>
Thu, 9 Mar 2017 04:30:35 +0000 (07:30 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 9 Mar 2017 04:30:35 +0000 (07:30 +0300)
* src/atomic_ops_malloc.c [__SIZEOF_SIZE_T__==8] (msb): Ignore by
CPPCHECK.

src/atomic_ops_malloc.c

index 499b145..77faa4e 100644 (file)
@@ -251,7 +251,7 @@ static unsigned msb(size_t s)
 {
   unsigned result = 0;
   if ((s & 0xff) != s) {
-#   if __SIZEOF_SIZE_T__ == 8
+#   if (__SIZEOF_SIZE_T__ == 8) && !defined(CPPCHECK)
       unsigned v = (unsigned)(s >> 32);
       if (v != 0)
         {