[PATCH 0/2] Address warnings from gcc 12.2 with -flto
The first one is a bogus report of an uninitialised field passed as input to hash functions for TCP connections, already seen with gcc 11. The second one is a bogus stringop-overread which already happened with gcc 12.1, but this time a "cute" pragma won't make it go away. Both harmless, but noisy. Based on pending series posted by David, if it matters. Stefano Brivio (2): Makefile: Extend noinline workarounds for LTO and -O2 to gcc 12 udp: Replace pragma to ignore bogus stringop-overread warning with workaround Makefile | 6 +++--- udp.c | 26 ++++++++++++++++++-------- util.h | 23 ----------------------- 3 files changed, 21 insertions(+), 34 deletions(-) -- 2.35.1
Commit 1a563a0cbd49 ("passt: Address gcc 11 warnings") works around an
issue where the remote address passed to hash functions is seen as
uninitialised by gcc, with -flto and -O2.
It turns out we get the same exact behaviour on gcc 12.1 and 12.2, so
extend the applicability of the same workaround to gcc 12.
Don't go further than that, though: should the issue reported at:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78993
happen to be fixed in a later version of gcc, we won't need the
noinline attributes anymore. Otherwise, we'll notice.
Signed-off-by: Stefano Brivio
Commit c318ffcb4c93 ("udp: Ignore bogus -Wstringop-overread for
write() from gcc 12.1") uses a gcc pragma to ignore a bogus warning,
which started appearing on gcc 12.1 (aarch64 and x86_64) due to:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103483
...but gcc 12.2 has the same issue. Not just that: if LTO is enabled,
the pragma itself is ignored (this wasn't the case with gcc 12.1),
because of:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80922
Drop the pragma, and assign a frame (in the networking sense) pointer
from the offset of the Ethernet header in the buffer, then pass it to
write() and pcap(), so that gcc doesn't obsess anymore with the fact
that an Ethernet header is 14 bytes and we're sending more than that.
Signed-off-by: Stefano Brivio
participants (1)
-
Stefano Brivio