Skip to content

Commit

Permalink
Make it an error to omit __builtin_available where needed
Browse files Browse the repository at this point in the history
This guarantees that we have proper version checks in place for APIs on
Apple platforms that are not necessarily available on the deployment
target.

Change-Id: I10060f8b910f2bb790aa4a9c6f8c5cdc14d7cf06
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
jakepetroules committed Sep 29, 2017
1 parent 7fd3cc3 commit 1e1de2b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mkspecs/features/qt_common.prf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ clang {
clang_ver = $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}
versionAtLeast(clang_ver, 3.5): \
QMAKE_CXXFLAGS_WARN_ON += -Wdate-time

# Clang/LLVM 5.0 and Xcode 9.0 introduced unguarded availability warnings.
# The same construct has been a hard error in Swift from the very beginning.
apple_ver = $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}
darwin:if(versionAtLeast(clang_ver, 5.0)|versionAtLeast(apple_ver, 9.0)): \
QMAKE_CXXFLAGS_WARN_ON += \
-Werror=unguarded-availability \
-Werror=unguarded-availability-new \
-Werror=unsupported-availability-guard
} else: gcc:!intel_icc {
QMAKE_CXXFLAGS_WARN_ON += -Wvla
# GCC 5 introduced -Wdate-time
Expand Down

0 comments on commit 1e1de2b

Please sign in to comment.