]> granicus.if.org Git - libatomic_ops/commitdiff
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 499b1451edb09dce4fadfca42f55fa7a97d5728e..77faa4ef63dd084332a80a0a1bb67ef923851f90 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)
         {