]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: thread: add parenthesis around values of locking macros
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Jun 2020 09:42:25 +0000 (11:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Jun 2020 09:46:44 +0000 (11:46 +0200)
commitdb57a142c31016ff3e0dd533cb2b4de14445781e
tree6b3de1bc1d59889a940a29c37e441b1a4b1c226b
parentd0712f3873546a0c24f3204ad75dd7eacd689602
BUILD: thread: add parenthesis around values of locking macros

clang just failed on fd.c with this error:

  src/fd.c:491:9: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses]
          while (HA_SPIN_TRYLOCK(OTHER_LOCK, &log_lock) != 0) {
                 ^                                      ~~
That's because this expands to this:

          while (!pl_try_s(&log_lock) != 0) {

Let's just add parenthesis in the TRYLOCK macros to avoid this.
This may need to be backported if commit df187875d ("BUG/MEDIUM: log:
don't hold the log lock during writev() on a file descriptor") is
backported as well as it seems to be the first one to trigger it.
include/haproxy/thread.h