BUILD: http_htx: silence uninitialized warning on some gcc versions
authorWilly Tarreau <w@1wt.eu>
Fri, 1 Dec 2023 14:29:44 +0000 (15:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 1 Dec 2023 19:46:24 +0000 (20:46 +0100)
commitdb812f73afdda225d7ddd1f887e08ce042e273dc
treefd739969cd9b4f681fbf00f5e83847f3b29bd59b
parentc2cd6a419cd376e3291b461558ad5cb172b8c5d4
BUILD: http_htx: silence uninitialized warning on some gcc versions

Building on gcc 4.4 reports "start may be used uninitialized". This is
a classical case of dependency between two variables where the compiler
lost track of their initialization and doesn't know that if one is not
set, the other is. By just moving the second test in the else clause
of the assignment both fixes it and makes the code more efficient, and
this can be simplified as a ternary operator.

It's probably not needed to backport this, unless anyone reports build
warnings with more recent compilers (intermediary optimization levels
such as -O1 can sometimes trigger such warnings).
src/http_htx.c