From: Willy Tarreau Date: Tue, 12 May 2026 06:40:32 +0000 (+0200) Subject: BUILD: compiler: fix redefinition of __nonstring X-Git-Tag: v3.4-dev12~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58f3e191e81e27342c2afcd4e78ed62b9650d9de;p=thirdparty%2Fhaproxy.git BUILD: compiler: fix redefinition of __nonstring Dmitry Sivachenko reported a build warning on FreeBSD -dev, where __nonstring is apparently already defined. Let's guard our own definition to avoid such issues. It could make sense to backport this to recent stable versions which may soon be exposed to modern compilers. --- diff --git a/include/haproxy/compiler.h b/include/haproxy/compiler.h index 608a668e6..3f7f3bc8e 100644 --- a/include/haproxy/compiler.h +++ b/include/haproxy/compiler.h @@ -583,10 +583,12 @@ * for such array declarations. But it's not the case for clang and other * compilers. */ -#if __has_attribute(nonstring) -#define __nonstring __attribute__ ((nonstring)) -#else -#define __nonstring +#ifndef __nonstring +# if __has_attribute(nonstring) +# define __nonstring __attribute__ ((nonstring)) +# else +# define __nonstring +# endif #endif #endif /* _HAPROXY_COMPILER_H */