diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/config/Make.rules.Linux | 8 | ||||
-rw-r--r-- | cpp/include/IceUtil/DisableWarnings.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/cpp/config/Make.rules.Linux b/cpp/config/Make.rules.Linux index 5d5717c9f82..d167b9c166c 100644 --- a/cpp/config/Make.rules.Linux +++ b/cpp/config/Make.rules.Linux @@ -79,7 +79,11 @@ ifeq ($(CXX),g++) endif endif - CXXFLAGS = $(CXXARCHFLAGS) -Wall -Werror -pthread + CXXFLAGS = $(CXXARCHFLAGS) -Wall -pthread + GCC_GTEQ_420 := $(shell expr `gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40200) + ifeq ($(GCC_GTEQ_420),1) + CXXFLAGS += -Werror + endif ifneq ($(GENPIC),no) CXXFLAGS += -fPIC @@ -165,4 +169,4 @@ ifneq ($(QT_HOME),) QT_FLAGS = -I$(QT_HOME)/include QT_LIBS = -L$(QT_HOME)/$(libsubdir) -lQtCore -lQtSql QT_RPATH_LINK = $(call rpathlink,$(QT_HOME)/$(libsubdir)) -endif
\ No newline at end of file +endif diff --git a/cpp/include/IceUtil/DisableWarnings.h b/cpp/include/IceUtil/DisableWarnings.h index 619ec3aa540..c91ee0ea44e 100644 --- a/cpp/include/IceUtil/DisableWarnings.h +++ b/cpp/include/IceUtil/DisableWarnings.h @@ -37,7 +37,7 @@ // // GCC // -#if defined(__GNUC__) +#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) # pragma GCC diagnostic warning "-Wdeprecated-declarations" #endif |