-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latest macOS system header causes compilation failures on GCC #2837
Comments
Why does the compilation fail there? Is this a hard error? |
Yes, that's hard errors. For example, on mac with the latest developer tools, this
produces the following error messages
The code |
Hmmm, yeah there was a reason why we are checking headers like this #if defined(__has_include)
#if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER) I'll accept a PR that adds the workaround. |
Thanks. I'll submit PR later. |
Signed-off-by: Blyschak <stepanblischak@gmail.com>
- Build scripts now to g++13 with classic linker - Catch2 picked fix catchorg/Catch2#2837 With the new macOS linker the build fails with a weird error. Turned out, we need gcc13 together with the classic linker to successfully build on the github runner.
- Build scripts now to g++13 with classic linker - Catch2 picked fix catchorg/Catch2#2837 With the new macOS linker the build fails with a weird error. Turned out, we need gcc13 together with the classic linker to successfully build on the github runner.
- Build scripts now to g++13 with classic linker - Catch2 picked fix catchorg/Catch2#2837 With the new macOS linker the build fails with a weird error. Turned out, we need gcc13 together with the classic linker to successfully build on the github runner.
Description
After recent developer tools update on macOS Sonoma (i.e. "Command Line Tools for Xcode 15.3"), some Catch2 headers fail to compile on GCC.
Test case
and
fail to compile on GCC 13 or earlier, after updating to "Command Line Tools for Xcode 15.3".
Background
"Command Line Tools for Xcode 15.3" introduces a problematic code at Line 140 of
usr/include/TargetConditionals.h
(i.e.MacOSX14.4.sdk/usr/include/TargetConditionals.h
):This is problematic, since compilers without
__has_extension
support cause compilation failure with it. Notably, GCC does not support__has_extension
until the next release (GCC 14).(I think this should be fixed upstream by Apple, but ...) it may make some sense to add guard for
__has_extension
:The text was updated successfully, but these errors were encountered: