On Thu, 6 Jun 2024 20:09:43 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote: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 <david(a)gibson.dropbear.id.au> --- 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 \On versions before 2.14, this now raises an unmatchedSuppression... I'm not sure how to deal with this. Should we give up and just add a --suppress=unmatchedSuppression for all the source files? I can't think of anything better at the moment. I applied the rest of the series, just not this patch. -- Stefano