From 3cf45ae841759fc3ee38704fddf56a984f861d8f Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 15 May 2018 12:39:03 +0300 Subject: [PATCH] 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. --- tools/setjmp_t.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c index fffc65c..bef71f2 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", -- 2.7.4