From 82a92743fcbaf1f88b05f31ab8d2f7093157aad1 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 9 Mar 2021 10:08:05 +0100 Subject: [PATCH] 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. --- include/haproxy/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index 57b7fc061..f5509c8f2 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 */ \