]> git.kaiwu.me - haproxy.git/commit
CLEANUP: quic: replace ALREADY_CHECKED() with ASSUME_NONNULL() at a few places
authorWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2024 13:54:20 +0000 (14:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 17 Dec 2024 16:47:57 +0000 (17:47 +0100)
commit7760e3a374d9eb1a4adae8209c07517252b6a4c4
tree56974735ba5ecb2a9660f89e122dbad6ab1299c1
parent1f93622779c8d2cc094134989b53431c874e1f0d
CLEANUP: quic: replace ALREADY_CHECKED() with ASSUME_NONNULL() at a few places

There were 4 instances of ALREADY_CHECKED() used to tell the compiler that
the argument couldn't be NULL by design. Let's change them to the cleaner
ASSUME_NONNULL(). Functions like qc_snd_buf() were slightly reduced in
size (-24 bytes).

Apparently gcc-13 sees a potential case that others don't see, and it's
likely a bug since depending what is masked, it will completely change
the output warnings to the point of contradicting itself. After many
attempts, it appears that just checking that CMSG_FIRSTHDR(msg) is not
null suffices to calm it down, so the strange warnings might have been
the result of an overoptimization based on a supposed UB in the first
place. At least now all versions up to 13.2 as well as clang are happy.
src/quic_loss.c
src/quic_sock.c