]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: epoll/threads: Add test on MAX_THREADS to avoid warnings when complied without...
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Jan 2018 15:18:09 +0000 (16:18 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 25 Jan 2018 16:52:57 +0000 (17:52 +0100)
commit3e805ed08ec1c16c29a59b6d08dc8d96f0b69e15
tree0af6cb2ae57ee6c519dbe46d0efe8d7d481be529
parentda18b9db7b26080b899985191c6344d79f5497b5
BUILD: epoll/threads: Add test on MAX_THREADS to avoid warnings when complied without threads

When HAProxy is complied without threads, gcc throws following warnings:

  src/ev_epoll.c:222:3: warning: array subscript is outside array bounds [-Warray-bounds]
  ...
  src/ev_epoll.c:199:11: warning: array subscript is outside array bounds [-Warray-bounds]
  ...

Of course, this is not a bug. In such case, tid is always equal to 0. But to
avoid the noise, a check on MAX_THREADS in "if (tid)" lines makes gcc happy.

This patch should be backported in 1.8 with the commit d9e7e36c ("BUG/MEDIUM:
epoll/threads: use one epoll_fd per thread").
src/ev_epoll.c