On Fri, Sep 29, 2023 at 05:31:34PM +0200, Stefano
Brivio wrote:
On Fri, 29 Sep 2023 15:50:18 +1000
David Gibson <david(a)gibson.dropbear.id.au> wrote:
cppcheck 2.12 (which Fedora 38 has updated, for
one) introduces a
number of new warnings. Unfortunately, at least one of these is a
clear bug in cppcheck.
This series fixes a number of the new warnings reported in passt
(patches 1..3) and works around the remaining cppcheck bug (patch 4).
I'm pretty confident that patches 1 & 2 are safe and beneficial to
apply regardless of which cppcheck we're using.
Patch 3 is a little more dubious, because it potentially increases the
cppcheck runtime. On my system it doesn't seem to make a significant
difference, but that might not always stay true.
On my system, it's 23 seconds instead of 21... I don't really see a
problem with that.
Right, it's like 16s vs 15s for me. I was just a bit concerned they
might add more, very expensive tests under the "exhaustive" set later
on.
Patch 4
is a tricky one. It applies a specific suppression to work
around the cppcheck bug. That's necessary to get a pass with the
currently available cppcheck. However, it's ugly and we'd like to
remove it once the bug is fixed, but have no obvious way to remind us
to do that. What we want to do here kind of depends how long it takes
the bug to be fixed, which isn't clear at the moment.
I don't see a big issue with this either, we already have one
suppression like that in tcp_clamp_window() where we kind of identified
the issue but it hasn't been solved yet.
Once it's fixed, we'll hopefully notice and drop the suppression if
cppcheck 2.12 is old enough by then, but if we don't, I don't think it's
a drama.
The whole series looks good to me by the way.
Ok. Well, apply whenever you're ready then, I guess.
Sure, applied now.
--
Stefano