Skip to content

Commit

Permalink
maint: avoid clang masquerading as gcc in ManyConfigTests
Browse files Browse the repository at this point in the history
__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.
  • Loading branch information
carenas committed Jan 14, 2025
1 parent 03c0977 commit 145d472
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maint/ManyConfigTests
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 145d472

Please sign in to comment.