]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: cache: fix a build warning with gcc < 7
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Apr 2024 07:36:33 +0000 (09:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Apr 2024 07:43:32 +0000 (09:43 +0200)
commit1c944eab08458b220861da4c17d32858534be6b2
tree8f9c3bc260b78b6263c403a6f32dfc3b65d40e06
parent50d8c187423d6b7e9b1083e05370885f6d12e844
BUILD: cache: fix a build warning with gcc < 7

Gcc before 7 does really not like direct operations on cast pointers
such as "((struct a*)b)->c += d;". It turns our that we have exactly
that construct in 3.0 since commit 5baa9ea168 ("MEDIUM: cache: Save
body size of cached objects and track it on delivery").

It's generally sufficient to use an intermediary variable such as :
"({ (struct a*) _ = b; _; })->c +=d;" but that's ugly. Fortunately
DISGUISE() implicitly does something very similar and works fine, so
let's use that.

No backport is needed.
src/cache.c