From: Willy Tarreau Date: Thu, 24 Nov 2022 06:51:57 +0000 (+0100) Subject: BUILD: compiler: include compiler's definitions before ours X-Git-Tag: v2.7-dev10~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d466385405295f769ec65291f511160ffd11ade;p=thirdparty%2Fhaproxy.git BUILD: compiler: include compiler's definitions before ours Building with TCC caused a warning on __attribute__() being redefined, because we do define it on compilers that don't have it, but we didn't include the compiler's definitions first to leave it a chance to expose its definitions. The correct way to do this would be to include sys/cdefs.h but we currently don't include it explicitly and a few reports on the net mention some platforms where it could be missing by default. Let's use inttypes.h instead, it always causes it (or its equivalent) to be included and we know it's present on supported platforms since we already depend on it. No backport is needed. --- diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h index 26d1d22dc7..2f23c74560 100644 --- a/include/haproxy/compiler.h +++ b/include/haproxy/compiler.h @@ -22,6 +22,11 @@ #ifndef _HAPROXY_COMPILER_H #define _HAPROXY_COMPILER_H +/* leave a chance to the compiler to bring its own definitions first; this + * will cause cdefs.h to be included on systems which have it. + */ +#include + #ifdef DEBUG_USE_ABORT #include #endif