]> granicus.if.org Git - gc/commitdiff
Workaround 'argument dummy to GC_noop1 is always 1' cppcheck false positive
authorIvan Maidanski <ivmai@mail.ru>
Wed, 19 Dec 2018 23:10:04 +0000 (02:10 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 19 Dec 2018 23:10:04 +0000 (02:10 +0300)
* misc.c [!ALWAYS_SMALL_CLEAR_STACK && !STACK_NOT_SCANNED
&& !ASM_CLEAR_CODE && CPPCHECK] (GC_clear_stack_inner): Pass dummy[0]
instead of address of dummy variable.

misc.c

diff --git a/misc.c b/misc.c
index e56c3de2155a7f080a38bcf8758a2d66f5138422..2390796a656ea9aad2f113b81f6e93f70da7af4c 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -314,7 +314,11 @@ STATIC void GC_init_size_map(void)
       }
       /* Make sure the recursive call is not a tail call, and the bzero */
       /* call is not recognized as dead code.                           */
-      GC_noop1(COVERT_DATAFLOW(dummy));
+#     if defined(CPPCHECK)
+        GC_noop1(dummy[0]);
+#     else
+        GC_noop1(COVERT_DATAFLOW(dummy));
+#     endif
       return(arg);
     }
 # endif /* !ASM_CLEAR_CODE */