From 6ce68113e38bd91ed9d31741a380972b34cbced6 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 28 Sep 2022 14:33:28 +1000 Subject: cppcheck: Broaden suppression for unused struct members 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 Signed-off-by: Stefano Brivio --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Makefile') 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 \ -- cgit v1.2.3