diff options
-rw-r--r-- | make/bsd/makefiles/gcc.make | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/make/bsd/makefiles/gcc.make b/make/bsd/makefiles/gcc.make index 3d201d294..95761cee7 100644 --- a/make/bsd/makefiles/gcc.make +++ b/make/bsd/makefiles/gcc.make @@ -87,6 +87,7 @@ ifeq ($(OS_VENDOR), Darwin) ifeq ($(DSYMUTIL),) DSYMUTIL=dsymutil endif + XCODE_VER := $(shell xcodebuild -version | head -n1 | sed 's/Xcode //' | cut -d'.' -f1) endif ifeq ($(USE_CLANG), true) @@ -257,7 +258,7 @@ ifeq ($(USE_CLANG), true) # Not yet supported by clang in Xcode 4.6.2 # WARNINGS_ARE_ERRORS += -Wno-tautological-constant-out-of-range-compare WARNINGS_ARE_ERRORS += -Wno-delete-non-virtual-dtor -Wno-deprecated -Wno-format -Wno-dynamic-class-memaccess - WARNINGS_ARE_ERRORS += -Wno-empty-body -Wno-shorten-64-to-32 -Wno-sign-conversion + WARNINGS_ARE_ERRORS += -Wno-empty-body endif WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef @@ -267,7 +268,15 @@ ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& # conversions which might affect the values. Only enable it in earlier versions. WARNING_FLAGS = -Wunused-function ifeq ($(USE_CLANG),) - WARNING_FLAGS += -Wno-conversion -Wno-logical-op-parentheses -Wno-tautological-undefined-compare -Wno-shift-negative-value -Wno-switch -Wno-format + ifeq ($(OS_VENDOR), Darwin) + ifeq "$(shell expr $(XCODE_VER) \>= 9 )" "1" + WARNING_FLAGS += -Wno-conversion -Wno-logical-op-parentheses -Wno-tautological-undefined-compare -Wno-shift-negative-value -Wno-switch -Wno-format -Wno-shorten-64-to-32 -Wno-sign-conversion + else + WARNING_FLAGS += -Wconversion + endif + else + WARNING_FLAGS += -Wconversion + endif endif endif |