Merge ihse-cflags-rewrite-branch
authorihse
Tue, 13 Mar 2018 11:33:57 +0100
branchihse-cflags-rewrite-branch
changeset 56285 9bc8db601fe2
parent 56251 57c4d01d02dc (diff)
parent 56284 8bf9a2a3ba82 (current diff)
child 56312 a52bcf4118eb
Merge
--- a/make/autoconf/flags-cflags.m4	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/autoconf/flags-cflags.m4	Tue Mar 13 11:33:57 2018 +0100
@@ -184,6 +184,18 @@
     microsoft)
       DISABLE_WARNING_PREFIX="-wd"
       CFLAGS_WARNINGS_ARE_ERRORS="-WX"
+      
+      # 4061
+      #WARNINGS_ENABLE_ALL="-Wall"
+      WARNINGS_ENABLE_ALL="-W4"
+      # 4061, 4062 = enum not handled
+      # 4130
+      #EVEN_MORE="4054 4055 4057 4100 4127 4131 4132 4152 4201 4204 4206 4210 4232 4244 4255 4263 4264 4295 4302 4306 4311 4324 4366 4388 4512 4548 4555 4574 4800 4986 4987"
+      #INIT_DISABLE=" 4189 4191 4211 4242 4245 4265 4287 4296 4310 4312 4350 4355 4365 4389 4505 4510 4514 4571 4610 4619 4623 4625 4626 4640 4668 4701 4702 4703 4706 4710 4711 4820 4917 4946 $EVEN_MORE"
+      #DISABLED_WARNINGS_WALL="4061 4062 $INIT_DISABLE"
+      RETRY_W4_HOTSPOT="4189 4211 4245 4310 4389 4505 4510 4610 4701 4702 4703 4706"
+      RETRY_W4_JDK="4054 4055 4057 4100 4127 4130 4131 4132 4152 4201 4204 4206 4210 4232 4244 4295 4306 4324 4366 4512 4800"
+      DISABLED_WARNINGS="$RETRY_W4_HOTSPOT $RETRY_W4_JDK"
       ;;
     solstudio)
       DISABLE_WARNING_PREFIX="-erroff="
@@ -193,8 +205,9 @@
       WARNINGS_ENABLE_ALL_CFLAGS="-v -fd -xtransition"
       WARNINGS_ENABLE_ALL_CXXFLAGS="+w +w2"
 
-      DISABLED_WARNINGS_C="E_OLD_STYLE_FUNC_DECL E_OLD_STYLE_FUNC_DEF E_SEMANTICS_OF_OP_CHG_IN_ANSI_C E_NO_REPLACEMENT_IN_STRING"
-      DISABLED_WARNINGS_CXX="inllargeuse doubunder notused wemptydecl wunreachable"
+      DISABLED_WARNINGS_C="E_OLD_STYLE_FUNC_DECL E_OLD_STYLE_FUNC_DEF E_SEMANTICS_OF_OP_CHG_IN_ANSI_C E_NO_REPLACEMENT_IN_STRING E_DECLARATION_IN_CODE"
+      DISABLED_WARNINGS_CXX="inllargeuse inllargeint notused wemptydecl notemsource"
+      # helpful quality checks, should not be disabled: inllargeuse inllargeint
       ;;
     gcc)
       # Prior to gcc 4.4, a -Wno-X where X is unknown for that version of gcc will cause an error
@@ -211,11 +224,15 @@
 
       # -Wall -Wextra does not enable all warnings. We add some more that we
       # consider relevant:
-      WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wreturn-type -Wsign-compare -Wtype-limits -Wundef -Wuninitialized -Wunused-function -Wunused-value"
-      WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual"
+      WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wundef -Wlogical-op -Winit-self -Wpacked -Wdisabled-optimization -Wtrampolines"
+      WARNINGS_ENABLE_ADDITIONAL_CXX="-Wc++0x-compat -Wreorder -Wnoexcept -Woverloaded-virtual -Wdelete-non-virtual-dtor -Wwrite-strings -Wstrict-null-sentinel"
+
       WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
       WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ADDITIONAL_CXX"
 
+      DISABLED_WARNINGS_JUST_GET_THIS_PASS="unused-variable unused-function unused-but-set-variable undef unused-value unused-label pointer-arith"
+      DISABLED_WARNINGS="unknown-warning unused-parameter $DISABLED_WARNINGS_JUST_GET_THIS_PASS"
+
       # Repeate the check for the BUILD_CC and BUILD_CXX. Need to also reset
       # CFLAGS since any target specific flags will likely not work with the
       # build compiler
@@ -251,6 +268,7 @@
   AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
   AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
   AC_SUBST(LDFLAGS_WARNINGS_ARE_ERRORS)
+  AC_SUBST(DISABLED_WARNINGS)
   AC_SUBST(DISABLED_WARNINGS_C)
   AC_SUBST(DISABLED_WARNINGS_CXX)
 ])
@@ -277,11 +295,11 @@
       FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [$STACK_PROTECTOR_CFLAG -Werror],
           IF_FALSE: [STACK_PROTECTOR_CFLAG=""])
 
-      CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
-      CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
+      CFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1 -Wstack-protector"
+      CXXFLAGS_DEBUG_OPTIONS="$STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1 -Wstack-protector"
 
       if test "x$STACK_PROTECTOR_CFLAG" != x; then
-        JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1"
+        JVM_CFLAGS_SYMBOLS="$JVM_CFLAGS_SYMBOLS $STACK_PROTECTOR_CFLAG --param ssp-buffer-size=1 -Wstack-protector"
       fi
       ;;
     esac
@@ -591,10 +609,11 @@
   # CFLAGS WARNINGS STUFF
   # Set JVM_CFLAGS warning handling
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
-    JDK_DISABLED="-Wno-pointer-arith -Wno-undef -Wno-unused-function -Wno-unused-value -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-unused-label"
-    JVM_DISABLED="-Wno-unknown-pragmas -Wno-comment -Wno-delete-non-virtual-dtor -Wno-ignored-qualifiers -Wno-parentheses -Wno-reorder -Wno-unused-local-typedefs -Wno-unused-parameter -Wno-unused-variable -Wno-address -Wno-missing-field-initializers -Wno-unused-but-set-variable -Wno-char-subscripts -Wno-array-bounds -Wno-narrowing -Wno-empty-body -Wno-unused-but-set-parameter"
+#    JDK_DISABLED="-Wno-pointer-arith -Wno-undef -Wno-unused-function -Wno-unused-value -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-variable -Wno-unused-label"
+#    JVM_DISABLED="-Wno-unknown-pragmas -Wno-comment -Wno-delete-non-virtual-dtor -Wno-ignored-qualifiers -Wno-parentheses -Wno-reorder -Wno-unused-local-typedefs -Wno-unused-parameter -Wno-unused-variable -Wno-address -Wno-missing-field-initializers -Wno-unused-but-set-variable -Wno-char-subscripts -Wno-array-bounds -Wno-narrowing -Wno-empty-body -Wno-unused-but-set-parameter"
 
     WARNING_CFLAGS_JDK="$WARNINGS_ENABLE_ALL $JDK_DISABLED"
+    WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
     WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
     WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL $WARNINGS_ENABLE_ALL_CXXFLAGS $JVM_DISABLED"
 
@@ -609,8 +628,9 @@
     WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
     WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
-    WARNING_CFLAGS="-W3"
-    WARNING_CFLAGS_JDK="-wd4800"
+    WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
+    #WARNING_CFLAGS="-W3"
+    #WARNING_CFLAGS_JDK="-wd4800"
   fi
 
   # Set some additional per-OS defines.
--- a/make/autoconf/spec.gmk.in	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/autoconf/spec.gmk.in	Tue Mar 13 11:33:57 2018 +0100
@@ -419,6 +419,7 @@
 DISABLE_WARNING_PREFIX := @DISABLE_WARNING_PREFIX@
 CFLAGS_WARNINGS_ARE_ERRORS:=@CFLAGS_WARNINGS_ARE_ERRORS@
 LDFLAGS_WARNINGS_ARE_ERRORS:=@LDFLAGS_WARNINGS_ARE_ERRORS@
+DISABLED_WARNINGS := @DISABLED_WARNINGS@
 DISABLED_WARNINGS_C := @DISABLED_WARNINGS_C@
 DISABLED_WARNINGS_CXX := @DISABLED_WARNINGS_CXX@
 
--- a/make/common/NativeCompilation.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/common/NativeCompilation.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -320,9 +320,9 @@
           # Windows.
 	  $$(call ExecuteWithLog, $$@, \
 	      $$($1_$2_COMP) $$($1_$2_FLAGS) -showIncludes $$($1_$2_DEBUG_OUT_FLAGS) \
-	          $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) \
+	          $(CC_OUT_OPTION)$$($1_$2_OBJ) $2) 2>&1 \
 	      | $(GREP) -v -e "^Note: including file:" \
-	          -e "^$(notdir $2)$$$$" || test "$$$$?" = "1" ; \
+	          -e "^$(notdir $2)" || test "$$$$?" = "1" ; \
 	  $(ECHO) $$@: \\ > $$($1_$2_DEP) ; \
 	  $(SED) $(WINDOWS_SHOWINCLUDE_SED_PATTERN) $$($1_$2_OBJ).log \
 	      | $(SORT) -u >> $$($1_$2_DEP) ; \
--- a/make/hotspot/gensrc/GensrcAdlc.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/hotspot/gensrc/GensrcAdlc.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -75,7 +75,6 @@
       OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
       DEBUG_SYMBOLS := false, \
       DISABLED_WARNINGS_clang := tautological-compare, \
-      DISABLED_WARNINGS_solstudio := notemsource, \
   ))
 
   ADLC_TOOL := $(BUILD_ADLC_TARGET)
--- a/make/hotspot/lib/CompileDtracePostJvm.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/hotspot/lib/CompileDtracePostJvm.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -52,8 +52,8 @@
         TOOLCHAIN := $(TOOLCHAIN_BUILD), \
         LDFLAGS := -m64, \
         CFLAGS := -m64 $(JVM_CFLAGS), \
-        DISABLED_WARNINGS_solstudio := hidef nokeyworddefine unknownpragma \
-            w_novirtualdescr, \
+        DISABLED_WARNINGS_solstudio := hidef w_novirtualdescr unknownpragma \
+            doubunder nokeyworddefine wunreachable, \
         OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets/objs, \
         OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/dtrace-gen-offsets, \
     ))
--- a/make/hotspot/lib/CompileGtest.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/hotspot/lib/CompileGtest.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -83,12 +83,16 @@
     CFLAGS_aix := -qpic=large, \
     CFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
-    DISABLED_WARNINGS_gcc := undef, \
+    DISABLED_WARNINGS_gcc := suggest-attribute=format unknown-pragmas comment \
+        delete-non-virtual-dtor ignored-qualifiers parentheses reorder \
+        unused-local-typedefs unused-variable address \
+        missing-field-initializers unused-but-set-variable char-subscripts \
+        array-bounds narrowing empty-body unused-but-set-parameter undef \
+        maybe-uninitialized logical-op \
+        implicit-fallthrough expansion-to-defined, \
     DISABLED_WARNINGS_clang := undef switch format-nonliteral \
         tautological-undefined-compare $(BUILD_LIBJVM_DISABLED_WARNINGS_clang), \
-    DISABLED_WARNINGS_solstudio := hidef inlafteruse inllargeint \
-        nokeyworddefine notemsource unknownpragma w_enumnotused \
-        wnoretvalue w_novirtualdescr w_toomanyenumnotused wvarhidenmem, \
+    DISABLED_WARNINGS_solstudio := $(BUILD_LIBJVM_DISABLED_WARNINGS_solstudio), \
     DISABLED_WARNINGS_CXX_microsoft := 4996, \
     LDFLAGS := $(JVM_LDFLAGS), \
     LDFLAGS_solaris := -library=stlport4 $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/hotspot/lib/CompileJvm.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/hotspot/lib/CompileJvm.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -224,10 +224,17 @@
     CXXFLAGS_DEBUG_SYMBOLS := $(JVM_CFLAGS_SYMBOLS), \
     vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
     arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
+    DISABLED_WARNINGS_gcc := suggest-attribute=format unknown-pragmas comment \
+        delete-non-virtual-dtor ignored-qualifiers parentheses reorder \
+        unused-local-typedefs unused-variable address \
+        missing-field-initializers unused-but-set-variable char-subscripts \
+        array-bounds narrowing empty-body unused-but-set-parameter \
+        maybe-uninitialized logical-op \
+        implicit-fallthrough expansion-to-defined, \
     DISABLED_WARNINGS_clang := tautological-compare, \
-    DISABLED_WARNINGS_solstudio := hidef inlafteruse inllargeint \
-        nokeyworddefine notemsource unknownpragma w_enumnotused \
-        wnoretvalue w_novirtualdescr w_toomanyenumnotused wvarhidenmem, \
+    DISABLED_WARNINGS_solstudio := hidef w_novirtualdescr inlafteruse \
+        unknownpragma doubunder w_enumnotused w_toomanyenumnotused \
+        wvarhidenmem wunreachable wnoretvalue, \
     DISABLED_WARNINGS_xlc := 1540-0216 1540-0198 1540-1090 1540-1639 \
         1540-1088 1500-010, \
     ASFLAGS := $(JVM_ASFLAGS), \
--- a/make/launcher/Launcher-jdk.pack.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/launcher/Launcher-jdk.pack.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -85,6 +85,7 @@
     CFLAGS_solaris := -KPIC, \
     CFLAGS_macosx := -fPIC, \
     DISABLED_WARNINGS_gcc := unused-result implicit-fallthrough, \
+    DISABLED_WARNINGS_solstudio := wunreachable, \
     MAPFILE := $(UNPACK_MAPFILE),\
     LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
         $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
--- a/make/lib/Awt2dLibraries.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/lib/Awt2dLibraries.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -237,7 +237,6 @@
     DISABLED_WARNINGS_gcc := sign-compare unused-result maybe-uninitialized \
         format-nonliteral parentheses, \
     DISABLED_WARNINGS_clang := logical-op-parentheses extern-initializer, \
-    DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE, \
     DISABLED_WARNINGS_microsoft := 4297 4244 4267 4996, \
     ASFLAGS := $(LIBAWT_ASFLAGS), \
     MAPFILE := $(LIBAWT_MAPFILE), \
@@ -360,8 +359,8 @@
             unused-result maybe-uninitialized format \
             format-security int-to-pointer-cast parentheses \
             implicit-fallthrough, \
-        DISABLED_WARNINGS_solstudio := E_DECLARATION_IN_CODE \
-            E_ASSIGNMENT_TYPE_MISMATCH E_NON_CONST_INIT, \
+        DISABLED_WARNINGS_solstudio := E_ASSIGNMENT_TYPE_MISMATCH \
+             E_NON_CONST_INIT, \
         MAPFILE := $(TOPDIR)/make/mapfiles/libawt_xawt/mapfile-vers, \
         LDFLAGS := $(LDFLAGS_JDKLIB) \
             $(call SET_SHARED_LIBRARY_ORIGIN) \
@@ -947,8 +946,7 @@
       DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result \
           maybe-uninitialized shift-negative-value implicit-fallthrough, \
       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
-      DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
-          E_STATEMENT_NOT_REACHED, \
+      DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
       DISABLED_WARNINGS_microsoft := 4018 4244 4267, \
       MAPFILE := $(TOPDIR)/make/mapfiles/libsplashscreen/mapfile-vers, \
       LDFLAGS := $(LIBSPLASHSCREEN_LDFLAGS) $(LDFLAGS_JDKLIB) \
--- a/make/lib/CoreLibraries.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/lib/CoreLibraries.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -368,9 +368,6 @@
     OPTIMIZATION := HIGH, \
     CFLAGS := $(LIBJLI_CFLAGS), \
     DISABLED_WARNINGS_gcc := maybe-uninitialized, \
-    DISABLED_WARNINGS_solstudio := \
-        E_ASM_DISABLES_OPTIMIZATION \
-        E_STATEMENT_NOT_REACHED, \
     MAPFILE := $(TOPDIR)/make/mapfiles/libjli/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-java.security.jgss.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/lib/Lib-java.security.jgss.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -40,6 +40,7 @@
       CFLAGS := $(CFLAGS_JDKLIB) $(addprefix -I, $(LIBJ2GSS_SRC)) \
           $(LIBJAVA_HEADER_FLAGS) \
           -I$(SUPPORT_OUTPUTDIR)/headers/java.security.jgss, \
+      DISABLED_WARNINGS_gcc := logical-op, \
       MAPFILE := $(TOPDIR)/make/mapfiles/libj2gss/mapfile-vers, \
       LDFLAGS := $(LDFLAGS_JDKLIB) \
           $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/Lib-jdk.hotspot.agent.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/lib/Lib-jdk.hotspot.agent.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -103,7 +103,7 @@
     OPTIMIZATION := NONE, \
     DISABLED_WARNINGS_microsoft := 4267, \
     DISABLED_WARNINGS_gcc := sign-compare, \
-    DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma, \
+    DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma doubunder, \
     OUTPUT_DIR := $(call FindLibDirForModule, $(MODULE)), \
     SRC := $(SA_SRC), \
     EXCLUDE_FILES := test.c saproc_audit.cpp $(SA_EXCLUDE_FILES), \
--- a/make/lib/Lib-jdk.pack.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/lib/Lib-jdk.pack.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -41,6 +41,7 @@
         $(LIBJAVA_HEADER_FLAGS), \
     CFLAGS_release := -DPRODUCT, \
     DISABLED_WARNINGS_gcc := implicit-fallthrough, \
+    DISABLED_WARNINGS_solstudio := wunreachable, \
     MAPFILE := $(TOPDIR)/make/mapfiles/libunpack/mapfile-vers, \
     LDFLAGS := $(LDFLAGS_JDKLIB) $(LDFLAGS_CXX_JDK) \
         $(call SET_SHARED_LIBRARY_ORIGIN), \
--- a/make/lib/NetworkingLibraries.gmk	Sat Mar 03 08:36:12 2018 +0100
+++ b/make/lib/NetworkingLibraries.gmk	Tue Mar 13 11:33:57 2018 +0100
@@ -32,7 +32,7 @@
     OPTIMIZATION := LOW, \
     CFLAGS := $(CFLAGS_JDKLIB) -I$(SUPPORT_OUTPUTDIR)/headers/java.base \
         $(LIBJAVA_HEADER_FLAGS) $(addprefix -I, $(LIBNET_SRC_DIRS)), \
-    DISABLED_WARNINGS_gcc := format-nonliteral, \
+    DISABLED_WARNINGS_gcc := format-nonliteral logical-op, \
     DISABLED_WARNINGS_clang := parentheses-equality constant-logical-operand, \
     DISABLED_WARNINGS_microsoft := 4244 4047 4133 4996, \
     DISABLED_WARNINGS_solstudio := E_ARG_INCOMPATIBLE_WITH_ARG_L, \