From: Ivan Maidanski Date: Tue, 15 May 2018 09:39:03 +0000 (+0300) Subject: Workaround 'function nested_sp is never used' cppcheck style warning X-Git-Tag: v7.6.8~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68e8c9d56f657e80816781a4a331e34919e03a4d;p=gc Workaround 'function nested_sp is never used' cppcheck style warning The warning should not be produced by cppcheck as nested_sp is assigned to nested_sp_fn variable. * tools/setjmp_t.c [CPPCHECK] (main): Call nested_sp() directly; add comment. --- diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c index 1850769d..012282ab 100644 --- a/tools/setjmp_t.c +++ b/tools/setjmp_t.c @@ -86,6 +86,9 @@ int main(void) sp = (word)(&sp); printf("This appears to be a %s running %s\n", MACH_TYPE, OS_TYPE); +# if defined(CPPCHECK) + (void)nested_sp(); /* to workaround a bug in cppcheck */ +# endif if (nested_sp_fn() < sp) { printf("Stack appears to grow down, which is the default.\n"); printf("A good guess for STACKBOTTOM on this machine is 0x%lx.\n",