[PATCH 0/2] Fix some problems with cppcheck-2.9.1 (from Fedora 37)
I updated to the latest tree and found I was getting some new cppcheck false positives. I suspect these are fixed in the latest upstream cppcheck, but they're still there for the one packaged in Fedora 37, which is a lot more convenient for me to use. Here are some workarounds for those failures. David Gibson (2): Work around weird false positives with cppcheck-2.9.1 Fix false positive if cppcheck doesn't give a false positive conf.c | 2 +- netlink.c | 2 +- tap.c | 2 +- tcp.c | 4 ++-- tcp_splice.c | 2 +- udp.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) -- 2.39.2
Commit 89e38f55 "treewide: Fix header includes to build with musl" added
extra #includes to work with musl. Unfortunately with the cppcheck version
I'm using (cppcheck-2.9-1.fc37.x86_64 in Fedora 37) this causes weird false
positives: specifically cppcheck seems to hit a #error in
On Tue, 21 Mar 2023 14:54:59 +1100
David Gibson
Commit 89e38f55 "treewide: Fix header includes to build with musl" added extra #includes to work with musl. Unfortunately with the cppcheck version I'm using (cppcheck-2.9-1.fc37.x86_64 in Fedora 37) this causes weird false positives: specifically cppcheck seems to hit a #error in
complaining about including it directly instead of via (which is not something we're doing). I have no idea why that would be happening; but I'm guessing it has to be a bug in the cpp implementation in that cppcheck version. In any case, it's possible to work around this by moving the include of
before the include of . So, do that.
Checked on Alpine, build against musl still works with this. Applied, I'll push it out in a bit. -- Stefano
da46fdac "tcp: Suppress knownConditionTrueFalse cppcheck false positive"
introduced a suppression to work around a cppcheck bug causing a false
positive warning. However, the suppression will itself cause a spurious
unmatchedSuppression warning if used with a version of cppcheck from before
the bug was introduced. That includes the packaged version of cppcheck in
Fedora.
Suppress the unmatchedSuppression as well.
Fixes: da46fdac
Signed-off-by: David Gibson
On Tue, 21 Mar 2023 14:55:00 +1100
David Gibson
da46fdac "tcp: Suppress knownConditionTrueFalse cppcheck false positive" introduced a suppression to work around a cppcheck bug causing a false positive warning. However, the suppression will itself cause a spurious unmatchedSuppression warning if used with a version of cppcheck from before the bug was introduced. That includes the packaged version of cppcheck in Fedora.
Suppress the unmatchedSuppression as well.
Oops, I always forget about those. Applied. -- Stefano
participants (2)
-
David Gibson
-
Stefano Brivio