From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 27/28] Mark unused functions for cppcheck Date: Wed, 28 Sep 2022 14:33:38 +1000 Message-ID: <20220928043339.613538-28-david@gibson.dropbear.id.au> In-Reply-To: <20220928043339.613538-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0364150904303537429==" --===============0364150904303537429== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit We have a couple of functions that are unused (for now) by design. Although at least one has a flag so that gcc doesn't warn, cppcheck has its own warnings about this. Add specific inline suppressions for these rather than a blanket suppression in the Makefile. Signed-off-by: David Gibson --- Makefile | 1 - igmp.c | 1 + siphash.c | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7b3f8e1..bb349c7 100644 --- a/Makefile +++ b/Makefile @@ -283,7 +283,6 @@ cppcheck: $(SRCS) $(HEADERS) $(SYSTEM_INCLUDES:%=--suppress=*:%/*) \ $(SYSTEM_INCLUDES:%=--suppress=unmatchedSuppression:%/*) \ --inline-suppr \ - --suppress=unusedFunction \ --suppress=unusedStructMember \ \ --suppress=unmatchedSuppression:dhcp.c \ diff --git a/igmp.c b/igmp.c index 2f3a9d1..da7e83d 100644 --- a/igmp.c +++ b/igmp.c @@ -13,4 +13,5 @@ */ /* TO BE IMPLEMENTED */ +/* cppcheck-suppress unusedFunction */ __attribute__((__unused__)) static void unused(void) { } diff --git a/siphash.c b/siphash.c index ec38848..37a6d73 100644 --- a/siphash.c +++ b/siphash.c @@ -177,6 +177,7 @@ uint64_t siphash_20b(const uint8_t *in, const uint64_t *k) * * Return: the 64-bit hash output */ +/* cppcheck-suppress unusedFunction */ uint32_t siphash_32b(const uint8_t *in, const uint64_t *k) { uint64_t *in64 = (uint64_t *)in; -- 2.37.3 --===============0364150904303537429==--