RFR (XS) Enable -Woverloaded-virtual for GCC in the HotSpot build

Mikael Gerdin mikael.gerdin at oracle.com
Thu Mar 19 13:56:12 UTC 2015


Hi,

I recently ran into a compiler warning which is enabled by default in 
Solaris Studio, since HotSpot builds with warnings-as-errors this failed 
the build only when I got to the Solaris build.
To catch this issue earlier for me (and a lot of others who use Linux as 
their preferred development platform) I suggest that we enable the 
equivalent warning for GCC.

The patch to implement the change is inined below:

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
@@ -207,7 +207,7 @@
    WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
  endif

-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef 
-Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef 
-Wunused-function -Wunused-value -Wformat=2 -Wreturn-type 
-Woverloaded-virtual

  ifeq ($(USE_CLANG),)
    # Since GCC 4.3, -Wconversion has changed its meanings to warn these 
implicit

I've verified the change by building on all linux platforms through JPRT.

/Mikael



More information about the build-dev mailing list