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: v8.0.0~186 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cf45ae841759fc3ee38704fddf56a984f861d8f;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 fffc65c6..bef71f21 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",