8208672: Enable -Wreorder in make files for gcc, clang
authortschatzl
Wed, 08 Aug 2018 15:31:07 +0200
changeset 51335 3965b3332610
parent 51334 cc2c79d22508
child 51336 d8cd1a8ae50f
8208672: Enable -Wreorder in make files for gcc, clang Reviewed-by: dholmes, ihse
make/autoconf/flags-cflags.m4
--- a/make/autoconf/flags-cflags.m4	Wed Aug 08 15:31:07 2018 +0200
+++ b/make/autoconf/flags-cflags.m4	Wed Aug 08 15:31:07 2018 +0200
@@ -543,14 +543,14 @@
   fi
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
     WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"
-    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual"
+    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wunused-value -Woverloaded-virtual -Wreorder"
 
     if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
       # Non-zero builds have stricter warnings
       WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wreturn-type"
     fi
   elif test "x$TOOLCHAIN_TYPE" = xclang; then
-    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated"
+    WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-deprecated -Wreorder"
     if test "x$OPENJDK_TARGET_OS" = xlinux; then
       WARNING_CFLAGS_JVM="$WARNING_CFLAGS_JVM -Wno-sometimes-uninitialized"
       WARNING_CFLAGS_JDK="-Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2"