From: Willy Tarreau Date: Sat, 14 Mar 2020 09:58:35 +0000 (+0100) Subject: MINOR: debug: consume the write() result in BUG_ON() to silence a warning X-Git-Tag: v2.2-dev5~60 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=15ed69fd3fa6c81972b72a4070608f934ef7672e;p=thirdparty%2Fhaproxy.git MINOR: debug: consume the write() result in BUG_ON() to silence a warning Tim reported that BUG_ON() issues warnings on his distro, as the libc marks some syscalls with __attribute__((warn_unused_result)). Let's pass the write() result through DISGUISE() to hide it. --- diff --git a/include/common/debug.h b/include/common/debug.h index df85522291..c6c154cde7 100644 --- a/include/common/debug.h +++ b/include/common/debug.h @@ -59,7 +59,7 @@ do { \ if (unlikely(cond)) { \ const char msg[] = "\nFATAL: bug condition \"" #cond "\" matched at " file ":" #line "\n"; \ - (void)write(2, msg, strlen(msg)); \ + DISGUISE(write(2, msg, strlen(msg))); \ CRASH_NOW(); \ } \ } while (0)