From: Willy Tarreau Date: Tue, 9 Mar 2021 09:08:05 +0000 (+0100) Subject: BUILD: bug: refine HA_LINK_ERROR() to only be used on gcc and derivatives X-Git-Tag: v2.4-dev12~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82a92743fcbaf1f88b05f31ab8d2f7093157aad1;p=thirdparty%2Fhaproxy.git BUILD: bug: refine HA_LINK_ERROR() to only be used on gcc and derivatives TCC happens to define __OPTIMIZE__ at -O2 but doesn't proceed with dead code elimination, resulting in ha_free() to always reference the link error symbol. Let's condition this test on __GCC__ which others like Clang also define. --- diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index 57b7fc061c..f5509c8f26 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -74,7 +74,7 @@ #endif /* When not optimizing, clang won't remove that code, so only compile it in when optimizing */ -#ifdef __OPTIMIZE__ +#if defined(__GNUC__) && defined(__OPTIMIZE__) #define HA_LINK_ERROR(what) \ do { \ /* provoke a build-time error */ \