]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: h1: silence an initiialized warning with gcc-4.7 and -Os
authorWilly Tarreau <w@1wt.eu>
Tue, 4 Oct 2022 06:02:03 +0000 (08:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Oct 2022 06:02:03 +0000 (08:02 +0200)
commit55d2e8577e5ae0e7ac0cdbf5201b4836b5d7ad3c
tree7ea18549863702e84887b93178a17544b27aa7f1
parent14f62688839dc7245ca87e040f14fbd2147698e6
BUILD: h1: silence an initiialized warning with gcc-4.7 and -Os

Building h1.c with gcc-4.7 -Os produces the following warning:

  src/h1.c: In function 'h1_headers_to_hdr_list':
  src/h1.c:1101:36: warning: 'ptr' may be used uninitialized in this function [-Wmaybe-uninitialized]

In fact ptr may be taken from sl.rq.u.ptr which is only initialized after
passing through the relevant states, but gcc doesn't know which states
are visited. Adding an ALREADY_CHECKED() statement there is sufficient to
shut it up and doesn't affect the emitted code.

This may be backported to stable versions to make sure that builds on older
distros and systems is clean.
src/h1.c