Skip to content

maint: avoid clang masquerading as gcc in ManyConfigTests#671

Merged
NWilson merged 1 commit intoPCRE2Project:masterfrom
carenas:nogcc
Jan 14, 2025
Merged

maint: avoid clang masquerading as gcc in ManyConfigTests#671
NWilson merged 1 commit intoPCRE2Project:masterfrom
carenas:nogcc

Conversation

@carenas
Copy link
Contributor

@carenas carenas commented Jan 13, 2025

Avoid confusing clang (as a system compiler in macOS or other platforms) with gcc by ManyConfigTests.

Comment on lines 116 to +118
# If the compiler is GCC or Clang, 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 -`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work? That's annoying, sorry.

We should fix the comment above to remove "or Clang".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be broken also with Intel's (at least the legacy) compiler as well then.

__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.
@NWilson NWilson merged commit 81dced9 into PCRE2Project:master Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants