Skip to content

Commit 81dced9

Browse files
authored
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.
1 parent 03c0977 commit 81dced9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

maint/ManyConfigTests

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ OFLAGS="-O0"
113113
CC="${CC:=cc}"
114114
ISGCC=0
115115

116-
# If the compiler is GCC or Clang, add a lot of warning switches.
116+
# If the compiler is GCC, add a lot of warning switches.
117117

118-
CC_VER_OUTPUT=`printf '#ifdef __GNUC__\nGCC=yes\n#endif\n' | $CC -E -`
118+
CC_VER_OUTPUT=`printf '#if defined(__GNUC__) && !defined(__clang__)\nGCC=yes\n#endif\n' | $CC -E -`
119119
if [ $? -eq 0 ] && (echo "$CC_VER_OUTPUT" | grep GCC=yes) >/dev/null; then
120120
echo "Treating $CC as GCC"
121121
ISGCC=1

0 commit comments

Comments
 (0)