diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-10-20 08:14:02 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-10-20 19:14:20 +0300 |
commit | c4ff637c436d16d6de176e4fec9bf6532664ecd5 (patch) | |
tree | 9e5a58fb318a9ba8024dc90c1168c888386acc17 /tests/staticroots_lib.c | |
parent | a04362752872280b3acd2b170dc9c0df5fbdd7b3 (diff) | |
download | bdwgc-c4ff637c436d16d6de176e4fec9bf6532664ecd5.tar.gz |
Eliminate 'struct treenode member is never used' cppcheck warning
* tests/staticroots_lib.c [CPPCHECK] (libsrl_getpelem): Define node
local variable (of treenode type) and pass its fields to GC_noop1().
Diffstat (limited to 'tests/staticroots_lib.c')
-rw-r--r-- | tests/staticroots_lib.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/staticroots_lib.c b/tests/staticroots_lib.c index 5275ec8b..4c19e39d 100644 --- a/tests/staticroots_lib.c +++ b/tests/staticroots_lib.c @@ -68,5 +68,9 @@ static struct treenode *root_nz[10] = { (struct treenode *)(GC_word)2 }; GC_TEST_EXPORT_API struct treenode ** libsrl_getpelem(int i, int j) { +# if defined(CPPCHECK) + struct treenode node = { 0, 0 }; + GC_noop1((GC_word)node.x | (GC_word)node.y); +# endif return &((j & 1) != 0 ? root_nz : root)[i]; } |