8144695: --disable-warnings-as-errors does not work for HotSpot build
Reviewed-by: kbarrett, ihse
--- a/hotspot/make/bsd/makefiles/gcc.make Mon Feb 08 18:54:09 2016 +0300
+++ b/hotspot/make/bsd/makefiles/gcc.make Thu Dec 17 16:12:58 2015 +0300
@@ -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)
--- a/hotspot/make/linux/makefiles/gcc.make Mon Feb 08 18:54:09 2016 +0300
+++ b/hotspot/make/linux/makefiles/gcc.make Thu Dec 17 16:12:58 2015 +0300
@@ -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
--- a/hotspot/make/solaris/makefiles/adlc.make Mon Feb 08 18:54:09 2016 +0300
+++ b/hotspot/make/solaris/makefiles/adlc.make Thu Dec 17 16:12:58 2015 +0300
@@ -66,17 +66,21 @@
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
# CFLAGS_WARN holds compiler options to suppress/enable warnings.
+CFLAGS_WARN = +w
# Compiler warnings are treated as errors
ifeq ($(shell expr $(COMPILER_REV_NUMERIC) \>= 509), 1)
- CFLAGS_WARN = +w -errwarn
+ WARNINGS_ARE_ERRORS ?= -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
--- a/hotspot/make/solaris/makefiles/gcc.make Mon Feb 08 18:54:09 2016 +0300
+++ b/hotspot/make/solaris/makefiles/gcc.make Thu Dec 17 16:12:58 2015 +0300
@@ -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
--- a/hotspot/make/solaris/makefiles/sparcWorks.make Mon Feb 08 18:54:09 2016 +0300
+++ b/hotspot/make/solaris/makefiles/sparcWorks.make Thu Dec 17 16:12:58 2015 +0300
@@ -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 #