summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-05-15 12:39:03 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-05-15 12:39:03 +0300
commit3cf45ae841759fc3ee38704fddf56a984f861d8f (patch)
tree255bf8c4d433eb35f11b6daca8f646906cdd66b7 /tools
parent7e890ec0726a8dbbe7dcb5b55e3315e8a702f70f (diff)
downloadbdwgc-3cf45ae841759fc3ee38704fddf56a984f861d8f.tar.gz
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.
Diffstat (limited to 'tools')
-rw-r--r--tools/setjmp_t.c3
1 files changed, 3 insertions, 0 deletions
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",