# HG changeset patch # User iignatyev # Date 1450306252 -10800 # Thu Dec 17 01:50:52 2015 +0300 # Node ID 0958fd9e3630389c9ef36097c2c4af9a365d8c3b # Parent 93cfdafc04364b8640e69343b04a86157a4b2c2c 8144695: --disable-warnings-as-errors does not work for HotSpot build Reviewed-by: duke diff --git a/make/bsd/makefiles/gcc.make b/make/bsd/makefiles/gcc.make --- a/make/bsd/makefiles/gcc.make +++ b/make/bsd/makefiles/gcc.make @@ -256,7 +256,7 @@ # Compiler warnings are treated as errors ifneq ($(COMPILER_WARNINGS_FATAL),false) - WARNINGS_ARE_ERRORS = -Werror + WARNINGS_ARE_ERRORS ?= -Werror endif ifeq ($(USE_CLANG), true) diff --git a/make/linux/makefiles/gcc.make b/make/linux/makefiles/gcc.make --- a/make/linux/makefiles/gcc.make +++ b/make/linux/makefiles/gcc.make @@ -203,7 +203,7 @@ endif # Compiler warnings are treated as errors -WARNINGS_ARE_ERRORS = -Werror +WARNINGS_ARE_ERRORS ?= -Werror ifeq ($(USE_CLANG), true) # However we need to clean the code up before we can unrestrictedly enable this option with Clang diff --git a/make/solaris/makefiles/adlc.make b/make/solaris/makefiles/adlc.make --- a/make/solaris/makefiles/adlc.make +++ b/make/solaris/makefiles/adlc.make @@ -66,7 +66,7 @@ CXXFLAGS += -DASSERT ifndef USE_GCC - # We need libCstd.so for adlc + # We need libCstd.so for adlc CFLAGS += -library=Cstd -g LFLAGS += -library=Cstd -g endif @@ -74,9 +74,12 @@ # CFLAGS_WARN holds compiler options to suppress/enable warnings. # Compiler warnings are treated as errors ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1) - CFLAGS_WARN = +w -errwarn + WARNINGS_ARE_ERRORS ?= -w -xwe endif -# When using compiler version 5.13 (Solaris Studio 12.4), calls to explicitly + +CFLAGS_WARN = $(WARNINGS_ARE_ERRORS) + +# When using compiler version 5.13 (Solaris Studio 12.4), calls to explicitly # instantiated template functions trigger this warning when +w is active. ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 513), 1) CFLAGS_WARN += -erroff=notemsource diff --git a/make/solaris/makefiles/gcc.make b/make/solaris/makefiles/gcc.make --- a/make/solaris/makefiles/gcc.make +++ b/make/solaris/makefiles/gcc.make @@ -117,7 +117,7 @@ # Compiler warnings are treated as errors -WARNINGS_ARE_ERRORS = -Werror +WARNINGS_ARE_ERRORS ?= -Werror # Enable these warnings. See 'info gcc' about details on these options WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat=2 diff --git a/make/solaris/makefiles/sparcWorks.make b/make/solaris/makefiles/sparcWorks.make --- a/make/solaris/makefiles/sparcWorks.make +++ b/make/solaris/makefiles/sparcWorks.make @@ -145,7 +145,8 @@ CFLAGS += -DDONT_USE_PRECOMPILED_HEADER # Compiler warnings are treated as errors -CFLAGS_WARN = -xwe +WARNINGS_ARE_ERRORS ?= -xwe +CFLAGS_WARN = $(WARNINGS_ARE_ERRORS) ################################################ # Begin current (>=5.9) Forte compiler options #