1
0
mirror of https://passt.top/passt synced 2024-09-28 10:05:47 +00:00

Mark unused functions for cppcheck

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 <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
David Gibson 2022-09-28 14:33:38 +10:00 committed by Stefano Brivio
parent cd05be75fb
commit f5d053034c
3 changed files with 2 additions and 1 deletions

View File

@ -283,7 +283,6 @@ cppcheck: $(SRCS) $(HEADERS)
$(SYSTEM_INCLUDES:%=--suppress=*:%/*) \ $(SYSTEM_INCLUDES:%=--suppress=*:%/*) \
$(SYSTEM_INCLUDES:%=--suppress=unmatchedSuppression:%/*) \ $(SYSTEM_INCLUDES:%=--suppress=unmatchedSuppression:%/*) \
--inline-suppr \ --inline-suppr \
--suppress=unusedFunction \
--suppress=unusedStructMember \ --suppress=unusedStructMember \
\ \
--suppress=unmatchedSuppression:dhcp.c \ --suppress=unmatchedSuppression:dhcp.c \

1
igmp.c
View File

@ -13,4 +13,5 @@
*/ */
/* TO BE IMPLEMENTED */ /* TO BE IMPLEMENTED */
/* cppcheck-suppress unusedFunction */
__attribute__((__unused__)) static void unused(void) { } __attribute__((__unused__)) static void unused(void) { }

View File

@ -177,6 +177,7 @@ uint64_t siphash_20b(const uint8_t *in, const uint64_t *k)
* *
* Return: the 64-bit hash output * Return: the 64-bit hash output
*/ */
/* cppcheck-suppress unusedFunction */
uint32_t siphash_32b(const uint8_t *in, const uint64_t *k) uint32_t siphash_32b(const uint8_t *in, const uint64_t *k)
{ {
uint64_t *in64 = (uint64_t *)in; uint64_t *in64 = (uint64_t *)in;