From 4d466385405295f769ec65291f511160ffd11ade Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 24 Nov 2022 07:51:57 +0100 Subject: [PATCH] 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. --- include/haproxy/compiler.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h index 26d1d22dc..2f23c7456 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