On Sat, 8 Jun 2024 16:32:22 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote:On Fri, Jun 07, 2024 at 08:49:40PM +0200, Stefano Brivio wrote:Oh, you're right, I instinctively thought it would be a much bigger mess, I didn't even try.On Thu, 6 Jun 2024 20:09:43 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote:No, I don't think we want to do that, that's likely to leave stale suppressions about. Although it logically makes sense to suppress this globally, there are only three spots it actually occurs, so I'll rewrite to suppress in just those places, along with a similarly local unmatchedSuppression suppression.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....of course. :) I just applied the new patch. -- StefanoI applied the rest of the series, just not this patch.Nice.. although this was the only one actually blocking other work.