]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: debug: Add braces to if statement calling only CHECK_IF()
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 19 Jul 2022 09:53:46 +0000 (11:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 19 Jul 2022 10:11:04 +0000 (12:11 +0200)
In src/ev_epoll.c, a CHECK_IF() is guarded by an if statement. So, when the
macro is empty, GCC (at least 11.3.1) is not happy because there is an if
statement with an empty body without braces... It is handled by
"-Wempty-body" option.

So, braces are added and GCC is now happy.

No backport needed.

src/ev_epoll.c

index 884c03837ff5b9a0be944c5edb262d477665c274..f35e1c29be6f03017742b16f9bdcf3f79325f2b8 100644 (file)
@@ -57,8 +57,9 @@ static void __fd_clo(int fd)
                 * wrong thread or during startup, which is what we're checking
                 * for. Regardless, it is not a problem to do so.
                 */
-               if (unlikely(!(global.mode & MODE_STARTING)))
+               if (unlikely(!(global.mode & MODE_STARTING))) {
                        CHECK_IF(tgid != tgrp && !thread_isolated());
+               }
 
                for (i = ha_tgroup_info[tgrp-1].base; i < ha_tgroup_info[tgrp-1].base + ha_tgroup_info[tgrp-1].count; i++)
                        if (m & ha_thread_info[i].ltid_bit)