summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-09-23 21:27:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-09-26 10:18:38 +0100
commit19549cfc22e9a5d442153d596d5db80efe819da7 (patch)
treedcfa9f63817bc619527d19d7e730673917611029 /solenv
parent51dcb469c013d3a8a301ca8e86dde3a420b5417f (diff)
take pity on the gcc 4.5.X users
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/unxgcc.mk19
-rw-r--r--solenv/inc/unxgcc.mk10
2 files changed, 24 insertions, 5 deletions
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 22e3835c7d59..f1c19897b978 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -108,7 +108,11 @@ endif
endif
gb_CCVER := $(shell $(gb_CC) -dumpversion | $(gb_AWK) -F. -- '{ print $$1*10000+$$2*100+$$3 }')
-gb_StrictAliasingUnsafe := $(shell expr $(gb_CCVER) \< 40600)
+gb_GccLess460 := $(shell expr $(gb_CCVER) \< 40600)
+
+#At least SLED 10.2 gcc 4.3 overly agressively optimizes uno::Sequence into
+#junk, so only strict-alias on >= 4.6.0
+gb_StrictAliasingUnsafe := $(gb_GccLess460)
ifeq ($(gb_StrictAliasingUnsafe),1)
gb_CFLAGS += -fno-strict-aliasing
@@ -121,7 +125,20 @@ gb_CXXFLAGS_WERROR := -Werror
endif
ifeq ($(HAVE_CXX0X),TRUE)
+#Currently, as well as for its own merits, c++11/c++0x mode allows use to use
+#a template for SAL_N_ELEMENTS to detect at compiler time its misuse
gb_CXXFLAGS += -std=c++0x
+
+#We have so many std::auto_ptr uses that we need to be able to disable
+#warnings for those so that -Werror continues to be useful, seeing as moving
+#to unique_ptr isn't an option when we must support different compilers
+
+#When we are using 4.6.0 we can use gcc pragmas to selectively silence auto_ptr
+#warnings in isolation, but for <= 4.5.X we need to globally disable
+#deprecation
+ifeq ($(gb_GccLess460),1)
+gb_CXXFLAGS += -Wno-deprecated-declarations
+endif
endif
ifeq ($(ENABLE_LTO),TRUE)
diff --git a/solenv/inc/unxgcc.mk b/solenv/inc/unxgcc.mk
index ff4b4facc4d8..a7eeaa4d91cf 100644
--- a/solenv/inc/unxgcc.mk
+++ b/solenv/inc/unxgcc.mk
@@ -89,6 +89,9 @@ CFLAGSCXX+=-fvisibility-inlines-hidden
.ENDIF # "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
.IF "$(HAVE_CXX0X)" == "TRUE"
CFLAGSCXX+=-std=c++0x
+.IF "$(GCCNUMVER)" <= "000400059999"
+CFLAGSCXX+=-Wno-deprecated-declarations
+.ENDIF
.ENDIF # "$(HAVE_CXX0X)" == "TRUE"
CFLAGS_CREATE_PCH=-x c++-header -I$(INCPCH) -DPRECOMPILED_HEADERS
@@ -115,10 +118,9 @@ GCCNUMVER:=$(shell @-$(CXX) $(GCCNUMVERSION_CMD))
# Compiler flags for enabling optimizations
.IF "$(PRODUCT)"!=""
CFLAGSOPT=$(CDEFAULTOPT) # optimizing for products
-.IF "$(GCCNUMVER)" <= "000400050000"
-#At least SLED 10.2 gcc 4.3 overly agressively optimizes
-#uno::Sequence into junk, so only strict-alias on compiler
-#later than 4.5.1
+.IF "$(GCCNUMVER)" <= "000400059999"
+#At least SLED 10.2 gcc 4.3 overly agressively optimizes uno::Sequence into
+#junk, so only strict-alias on >= 4.6.0
CFLAGSOPT+=-fno-strict-aliasing
.ENDIF
.ELSE # "$(PRODUCT)"!=""