From: Willy Tarreau Date: Mon, 21 Dec 2020 09:27:18 +0000 (+0100) Subject: BUILD: plock: remove dead code that causes a warning in gcc 11 X-Git-Tag: v2.1.11~14 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=b14887fac58637e0436d861e94eecaa98971f86a;p=haproxy-2.1.git BUILD: plock: remove dead code that causes a warning in gcc 11 As Ilya reported in issue #998, gcc 11 complains about misleading code indentation which is in fact caused by dead assignments to zero after a loop which stops on zero. Let's clean both of these. (cherry picked from commit b1f54925fc17b00ddbe25e30c2207a8d68d47f34) Signed-off-by: Christopher Faulet (cherry picked from commit 775c665f20c695ad92fdb4318d5c77097ba15d7a) Signed-off-by: Christopher Faulet (cherry picked from commit 78c677589e423f703cd9f5caefb28ed23bfba2a1) Signed-off-by: Christopher Faulet --- diff --git a/include/import/plock.h b/include/import/plock.h index 22244c5..058cc18 100644 --- a/include/import/plock.h +++ b/include/import/plock.h @@ -233,7 +233,6 @@ while (__pl_r) \ __pl_r = pl_deref_long(lock) - \ (PLOCK64_WL_1 | PLOCK64_SL_1 | PLOCK64_RL_1); \ - __pl_r = 0; \ } \ } \ !__pl_r; /* return value */ \ @@ -251,7 +250,6 @@ while (__pl_r) \ __pl_r = pl_deref_int(lock) - \ (PLOCK32_WL_1 | PLOCK32_SL_1 | PLOCK32_RL_1); \ - __pl_r = 0; \ } \ } \ !__pl_r; /* return value */ \