8204294: [REDO] - JVMFlag::printError missing ATTRIBUTE_PRINTF
authorgziemski
Wed, 03 Oct 2018 12:34:22 -0500
changeset 52004 22ca7ba0c50c
parent 52003 be4614f04eb6
child 52005 4236fa9582bb
8204294: [REDO] - JVMFlag::printError missing ATTRIBUTE_PRINTF Summary: Added ATTRIBUTE_PRINTF to JVMFlag::printError Reviewed-by: kbarrett, coleenp
src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp
src/hotspot/share/runtime/flags/jvmFlag.hpp
src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp
src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
--- a/src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp	Wed Oct 03 18:46:26 2018 +0200
+++ b/src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp	Wed Oct 03 12:34:22 2018 -0500
@@ -136,7 +136,6 @@
       return JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
-
   return JVMFlag::SUCCESS;
 }
 
@@ -151,12 +150,11 @@
     if (value % HeapWordSize != 0) {
       JVMFlag::printError(verbose,
                           "CMSRescanMultiple (" SIZE_FORMAT ") must be "
-                          "a multiple of " SIZE_FORMAT "\n",
+                          "a multiple of %d\n",
                           value, HeapWordSize);
       status = JVMFlag::VIOLATES_CONSTRAINT;
     }
   }
-
   return status;
 }
 
--- a/src/hotspot/share/runtime/flags/jvmFlag.hpp	Wed Oct 03 18:46:26 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlag.hpp	Wed Oct 03 12:34:22 2018 -0500
@@ -272,7 +272,7 @@
 
   // printRanges will print out flags type, name and range values as expected by -XX:+PrintFlagsRanges
   static void printFlags(outputStream* out, bool withComments, bool printRanges = false, bool skipDefaults = false);
-  static void printError(bool verbose, const char* msg, ...);
+  static void printError(bool verbose, const char* msg, ...) ATTRIBUTE_PRINTF(2, 3);
 
   static void verify() PRODUCT_RETURN;
 };
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp	Wed Oct 03 18:46:26 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp	Wed Oct 03 12:34:22 2018 -0500
@@ -94,7 +94,7 @@
   if (value < 0 || value > 512) {
     JVMFlag::printError(verbose,
                         "AllocatePrefetchDistance (" INTX_FORMAT ") must be "
-                        "between 0 and " INTX_FORMAT "\n",
+                        "between 0 and %d\n",
                         AllocatePrefetchDistance, 512);
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
@@ -162,7 +162,7 @@
       JVMFlag::printError(verbose,
                           "CompileThreshold * (InterpreterProfilePercentage - OnStackReplacePercentage) / 100 = "
                           INTX_FORMAT " "
-                          "must be between 0 and " INTX_FORMAT ", try changing "
+                          "must be between 0 and %d, try changing "
                           "CompileThreshold, InterpreterProfilePercentage, and/or OnStackReplacePercentage\n",
                           (CompileThreshold * (OnStackReplacePercentage - InterpreterProfilePercentage)) / 100,
                           INT_MAX >> InvocationCounter::count_shift);
@@ -182,7 +182,7 @@
     if (backward_branch_limit < 0) {
       JVMFlag::printError(verbose,
                           "CompileThreshold * OnStackReplacePercentage / 100 = " INTX_FORMAT " "
-                          "must be between 0 and " INTX_FORMAT ", try changing "
+                          "must be between 0 and %d, try changing "
                           "CompileThreshold and/or OnStackReplacePercentage\n",
                           (CompileThreshold * OnStackReplacePercentage) / 100,
                           INT_MAX >> InvocationCounter::count_shift);
@@ -395,8 +395,8 @@
 #if INCLUDE_RTM_OPT
   if (UseRTMLocking && !is_power_of_2(RTMTotalCountIncrRate)) {
     JVMFlag::printError(verbose,
-                        "RTMTotalCountIncrRate (" INTX_FORMAT
-                        ") must be a power of 2, resetting it to 64\n",
+                        "RTMTotalCountIncrRate (%d) must be "
+                        "a power of 2, resetting it to 64\n",
                         RTMTotalCountIncrRate);
     FLAG_SET_DEFAULT(RTMTotalCountIncrRate, 64);
   }
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp	Wed Oct 03 18:46:26 2018 +0200
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp	Wed Oct 03 12:34:22 2018 -0500
@@ -42,8 +42,8 @@
   if (value >= (intx)os::vm_page_size()) {
     JVMFlag::printError(verbose,
                         "ObjectAlignmentInBytes (" INTX_FORMAT ") must be "
-                        "less than page size (" INTX_FORMAT ")\n",
-                        value, (intx)os::vm_page_size());
+                        "less than page size (%d)\n",
+                        value, os::vm_page_size());
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
   return JVMFlag::SUCCESS;
@@ -79,7 +79,7 @@
   if ((value % PeriodicTask::interval_gran) != 0) {
     JVMFlag::printError(verbose,
                         "BiasedLockingStartupDelay (" INTX_FORMAT ") must be "
-                        "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
+                        "evenly divisible by PeriodicTask::interval_gran (%d)\n",
                         value, PeriodicTask::interval_gran);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {
@@ -123,7 +123,7 @@
   if ((value % PeriodicTask::interval_gran != 0)) {
     JVMFlag::printError(verbose,
                         "PerfDataSamplingInterval (" INTX_FORMAT ") must be "
-                        "evenly divisible by PeriodicTask::interval_gran (" INTX_FORMAT ")\n",
+                        "evenly divisible by PeriodicTask::interval_gran (%d)\n",
                         value, PeriodicTask::interval_gran);
     return JVMFlag::VIOLATES_CONSTRAINT;
   } else {