In a number of places in passt we use structures to represent over the wire or in-file data with a fixed layout. After initialization we don't access the fields individually and just write the structure as a whole to its destination. Unfortunately cppcheck doesn't cope with this pattern and thinks all the structure members are unused. We already have suppressions for this in pcap.c and dhcp.c However, it also appears in dhcp.c and netlink.c at least. Since this is likely to be common, it seems wiser to just suppress the error globally. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7c0b7e9..e3ca17f 100644 --- a/Makefile +++ b/Makefile @@ -286,10 +286,9 @@ cppcheck: $(SRCS) $(HEADERS) --suppress=objectIndex:tcp.c --suppress=objectIndex:udp.c \ --suppress=va_list_usedBeforeStarted:util.c \ --suppress=unusedFunction \ + --suppress=unusedStructMember \ --suppress=knownConditionTrueFalse:conf.c \ --suppress=localtimeCalled:pcap.c \ - --suppress=unusedStructMember:pcap.c \ - --suppress=unusedStructMember:dhcp.c \ \ --suppress=unmatchedSuppression:conf.c \ --suppress=unmatchedSuppression:dhcp.c \ -- 2.37.3