'comp_res_ring' is only read when haproxy is built with SLZ, but it is
unconditionally set by the 'tune.comp.res.ring' parser, so with a zlib-only
or compression-less build, clang 23 reports:
src/compression.c:334:12: error: variable 'comp_res_ring' set but not used
[-Werror,-Wunused-but-set-global]
This is caught by the Fedora rawhide CI (clang 23) which builds with
USE_ZLIB=1. It is not reproducible with older clang releases which do
not implement -Wunused-but-set-global.
Mark the variable __maybe_unused like other variables only used
conditionally. This does not change the behavior: the keyword remains
accepted and ignored on non-SLZ builds.
This should fix the issue #3609.
/* "tune.comp.res.ring": rings may be allocated for responses (default) */
-static int comp_res_ring __read_mostly = 1;
+static int comp_res_ring __read_mostly __maybe_unused = 1;
#ifdef USE_SLZ