]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: fd: fix a build warning on the DWCAS
authorWilly Tarreau <w@1wt.eu>
Sat, 17 Sep 2022 09:15:29 +0000 (11:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 17 Sep 2022 09:20:44 +0000 (11:20 +0200)
commit85af76070412d87433fbcaa0ac95833a8470159d
tree6daab2fb056c1824eabe964c778a09032eacad4a
parentda9f25875958757fd1f16b74bd887977e78c8b09
BUILD: fd: fix a build warning on the DWCAS

Ilya reported in issue #1816 a build warning on armhf (promoted to error
here since -Werror):

  src/fd.c: In function fd_rm_from_fd_list:
  src/fd.c:209:87: error: passing argument 3 of __ha_cas_dw discards volatile qualifier from pointer target type [-Werror=discarded-array-qualifiers]
    209 |    unlikely(!_HA_ATOMIC_DWCAS(((long *)&fdtab[fd].update), (uint32_t *)&cur_list.u32, &next_list.u32))
        |                                                                                       ^~~~~~~~~~~~~~

This happens only on such an architecture because the DWCAS requires the
pointer not the value, and gcc seems to be needlessly picky about reading
a const from a volatile! This may safely be backported to older versions.
src/fd.c