From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 706065A0059 for ; Thu, 06 Jun 2024 12:10:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1717668601; bh=qYxvn88u900gyMK4JtM9HWG3i90HdX2zZlphIBEliRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mV7/EobdnfRZ4scmfWaX0GONd+ath1M0z99T5TN4YvKyg8e33XMe3aBHSNA3jggnP 4D50ZC5h6Kq2DqwPLAMc8v+46VSY9wJzXClwxupm0a5TR3AP76YbxubqulQfIrYf6s BuQWwODqdj/wursCE5uheNFTfkguelXavEaD4QGRa0AAJPaFzEJZ5MnqZ0HCtgQ0hr RJLzVyfE28h7bipGLUjeKsacBA767sMRKEeXwNakJMPY8NwTvqR3tlq4ZXSFucI4hX b1bIa3cPVvL5sAhLLNryfSxXTcrwatf/e2IjZPMbHuTN5Dr9LjFB6Rb9ykVf7BwjAC 7Aw4dGFFGFP8w== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Vw0ST430Fz4x12; Thu, 6 Jun 2024 20:10:01 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 3/9] cppcheck: Suppress constParameterCallback errors Date: Thu, 6 Jun 2024 20:09:43 +1000 Message-ID: <20240606100949.1250958-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240606100949.1250958-1-david@gibson.dropbear.id.au> References: <20240606100949.1250958-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: YEBWX2KP6F4HMG5V7ATNC7BOTAPID36Z X-Message-ID-Hash: YEBWX2KP6F4HMG5V7ATNC7BOTAPID36Z X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We have several functions which are used as callbacks for NS_CALL() which only read their void * parameter, they don't write it. The new constParameterCallback warning in cppcheck 2.14.1 complains that this parameter could be const void *, also pointing out that that would require casting the function pointer when used as a callback. Casting the function pointers seems substantially uglier than using a non-const void * as the parameter, especially since in each case we cast the void * to a const pointer of specific type immediately. So, suppress that error from cppcheck. Signed-off-by: David Gibson --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 8ea17576..22f05813 100644 --- a/Makefile +++ b/Makefile @@ -314,5 +314,6 @@ cppcheck: $(SRCS) $(HEADERS) $(SYSTEM_INCLUDES:%=--suppress=unmatchedSuppression:%/*) \ --inline-suppr \ --suppress=unusedStructMember \ + --suppress=constParameterCallback \ $(filter -D%,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) \ $(SRCS) $(HEADERS) -- 2.45.2