On Thu, Nov 07, 2024 at 03:55:16PM +0100, Stefano Brivio wrote:
On Wed, 6 Nov 2024 17:54:13 +1100 David Gibson
wrote: It turns out cppcheck has inbuilt knowledge of the C library, and isn't typically given the system headers. Avoiding doing so reduces the runtime to less than half of what it currently is.
For non-obvious reasons, this change also exposes some new warnings. Some are real, one is a cppcheck bug. Fix and/or workaround these then make the change to the cppcheck options.
This is based on my earlier series with clangd configuration and fixes.
David Gibson (8): linux_dep: Generalise tcp_info.h to handling Linux extension compatibility log: Only check for FALLOC_FL_COLLAPSE_RANGE availability at runtime linux_dep: Move close_range() conditional handling to linux_dep.h linux_dep: Fix CLOSE_RANGE_UNSHARE availability handling ndp: Use const pointer for ndp_ns packet udp: Don't dereference uflow before NULL check in udp_reply_sock_handler() util: Work around cppcheck bug 6936 cppcheck: Don't check the system headers
Applied, except for 2/8, 3/8, 4/8, and 8/8.
I had to skip 8/8 as well for the moment because, contrary to what I reported earlier by mistake, it's actually the one leading to the new cppcheck warning:
dhcpv6.c:334:14: style: The comparison 'ia_type == 3' is always true. [knownConditionTrueFalse] if (ia_type == OPT_IA_NA) {
...also on x86. The difference is not the architecture, rather the cppcheck version: it happens with 2.16.x but not with 2.14.x.
I'm posting a patch for that soon.
Oh, interesting. 8/8 exposed several new warnings for me too (hence most of this series), but not that one. -- David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson