summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2022-02-18 00:21:34 +0300
committerIvan Maidanski <ivmai@mail.ru>2022-02-18 00:22:35 +0300
commitc3d6688d2e0308f224096fd5bc75ffc689a22fda (patch)
treee58faeab0dd75ef5ae77f77b79ca86e1583c54b7
parent037938630e9d938bc228fbf9dbedb86b5db9b166 (diff)
downloadlibatomic_ops-c3d6688d2e0308f224096fd5bc75ffc689a22fda.tar.gz
Eliminate 'le::next is never used' cppcheck warning in test_stack
(fix of commit 037938630) * tests/test_stack.c [CPPCHECK] (add_elements): Set le->e.next to 0 before AO_stack_push() call; add comment.
-rw-r--r--tests/test_stack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/test_stack.c b/tests/test_stack.c
index 685f61c..4025c7e 100644
--- a/tests/test_stack.c
+++ b/tests/test_stack.c
@@ -109,6 +109,9 @@ void add_elements(int n)
fprintf(stderr, "Out of memory\n");
exit(2);
}
+# if defined(CPPCHECK)
+ le->e.next = 0; /* mark field as used */
+# endif
le->e.data = n;
AO_stack_push(&the_list, &le->next);
}