From 81dced9442dde94a7bd17b135e8f58eea5fd6345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Tue, 14 Jan 2025 06:12:26 -0800 Subject: [PATCH] maint: avoid clang masquerading as gcc in ManyConfigTests (#671) __GNUC__ is defined by any compiler that claims compliance to GNU but that doesn't include the cmdline interface, so avoid passing GCC specific warning flags to clang. --- maint/ManyConfigTests | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/maint/ManyConfigTests b/maint/ManyConfigTests index 58718737c..8387bd8d9 100755 --- a/maint/ManyConfigTests +++ b/maint/ManyConfigTests @@ -113,9 +113,9 @@ OFLAGS="-O0" CC="${CC:=cc}" ISGCC=0 -# If the compiler is GCC or Clang, add a lot of warning switches. +# If the compiler is GCC, add a lot of warning switches. -CC_VER_OUTPUT=`printf '#ifdef __GNUC__\nGCC=yes\n#endif\n' | $CC -E -` +CC_VER_OUTPUT=`printf '#if defined(__GNUC__) && !defined(__clang__)\nGCC=yes\n#endif\n' | $CC -E -` if [ $? -eq 0 ] && (echo "$CC_VER_OUTPUT" | grep GCC=yes) >/dev/null; then echo "Treating $CC as GCC" ISGCC=1