You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
catch2 fails to build on OS X 10.10 Yosemite using the version of Apple clang in Xcode 7.2.1, the latest version that is compatible with Yosemite. The error is:
This code fails to take into account the fact that Apple clang and open source clang use different version numbering schemes. Although this flag may have been introduced in open source clang 3.8, it was evidently not introduced in Apple clang until a later version number.
Any time you want to check the clang version number, you must first check whether you are dealing with Apple clang or open source clang. You can do this by checking whether __apple_build_version__ is defined. If it is, then it's Apple clang. If you know which Apple build version the feature was introduced in, you can compare that build version with that define.
For example, on this version of Apple clang from Xcode 7.2.1:
On another machine running the next version of OS X, 10.11 El Capitan, with the newer Xcode 8.2.1 that can run on that system, -Wdouble-promotion appears to be supported. Its Apple clang version info:
So I suggest that you check if __apple_build_version__ is defined.
If yes and it's >= 8000038 then -Wdouble-promotion is supported.
If no then do your existing check using __clang_major__ and __clang_minor__.
(800.0.38 is the version number of Apple clang in Xcode 8.0, the first version of Xcode compatible with OS X 10.11 El Capitan. It is Apple's tendency to introduce new features in new major Xcode versions so I assume they introduced this flag in this version.)
The text was updated successfully, but these errors were encountered:
Describe the bug
catch2 fails to build on OS X 10.10 Yosemite using the version of Apple clang in Xcode 7.2.1, the latest version that is compatible with Yosemite. The error is:
Expected behavior
Successful build
Reproduction steps
Build catch2 with Apple clang from Xcode 7.2.1 on OS X 10.10 Yosemite.
Platform information:
Additional context
The problem is happening because Condition.tests.cpp contains this code:
This code fails to take into account the fact that Apple clang and open source clang use different version numbering schemes. Although this flag may have been introduced in open source clang 3.8, it was evidently not introduced in Apple clang until a later version number.
Any time you want to check the clang version number, you must first check whether you are dealing with Apple clang or open source clang. You can do this by checking whether
__apple_build_version__
is defined. If it is, then it's Apple clang. If you know which Apple build version the feature was introduced in, you can compare that build version with that define.For example, on this version of Apple clang from Xcode 7.2.1:
On another machine running the next version of OS X, 10.11 El Capitan, with the newer Xcode 8.2.1 that can run on that system,
-Wdouble-promotion
appears to be supported. Its Apple clang version info:So I suggest that you check if
__apple_build_version__
is defined.If yes and it's >= 8000038 then
-Wdouble-promotion
is supported.If no then do your existing check using
__clang_major__
and__clang_minor__
.(800.0.38 is the version number of Apple clang in Xcode 8.0, the first version of Xcode compatible with OS X 10.11 El Capitan. It is Apple's tendency to introduce new features in new major Xcode versions so I assume they introduced this flag in this version.)
The text was updated successfully, but these errors were encountered: