--- old/common/autoconf/toolchain.m4 2013-12-17 16:38:19.191740057 -0800 +++ new/common/autoconf/toolchain.m4 2013-12-17 16:38:19.111740053 -0800 @@ -807,8 +807,9 @@ # Later we will also have CFLAGS and LDFLAGS for the hotspot subrepo build. # case $COMPILER_NAME in - gcc ) - CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -W -Wall -Wno-unused -Wno-parentheses \ + gcc ) + # these options are used for both C and C++ compiles + CCXXFLAGS_JDK="$CCXXFLAGS $CCXXFLAGS_JDK -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wno-unused -Wno-parentheses \ -pipe \ -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE" case $OPENJDK_TARGET_CPU_ARCH in --- old/hotspot/make/linux/makefiles/gcc.make 2013-12-17 16:38:19.743740084 -0800 +++ new/hotspot/make/linux/makefiles/gcc.make 2013-12-17 16:38:19.631740078 -0800 @@ -214,7 +214,7 @@ WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body endif -WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat -Wformat-security ifeq ($(USE_CLANG),) # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit --- old/hotspot/make/solaris/makefiles/gcc.make 2013-12-17 16:38:20.299740111 -0800 +++ new/hotspot/make/solaris/makefiles/gcc.make 2013-12-17 16:38:20.195740106 -0800 @@ -118,7 +118,7 @@ # Compiler warnings are treated as errors WARNINGS_ARE_ERRORS = -Werror # Enable these warnings. See 'info gcc' about details on these options -WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef +WARNING_FLAGS = -Wpointer-arith -Wconversion -Wsign-compare -Wundef -Wformat -Wformat-security CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(WARNING_FLAGS) # Special cases CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))