On 2. 6. 25 05:25, Branko Čibej wrote:
On 1. 6. 25 22:06, Daniel Sahlberg wrote:
Hi,
When checking Brane's work on the CMake build system, I investigated
a few
compiler warnings. There are a few instances of "‘avail’ may be used
uninitialized", Avail is passed to select_value (as the parameter
*len) and
SHOULD be initialized there, however there is a default:-statement in a
switch that is "Not reachable" according to a comment and this path
leaves
*len uninitialised.
That's in serf_headers_read(), right? Well, the compiler is wrong,
because select_value() just returned from the case (ctx->state ==
READ_DONE), so avail is definitely initialized to NULL, and its value
used in serf_headers_read() only if (ctx->state == READ_DONE). I
prefer to leave such warnings alone, because silencing them only
papers over a compiler limitation.
By the way, I don't see this warning from clang, neither at -O0 nor at
-O3. Which compiler is this? gcc?
Yup, I see it now. with gcc-12.
-- Brane