8204294: [REDO] - JVMFlag::printError missing ATTRIBUTE_PRINTF

Added ATTRIBUTE_PRINTF to JVMFlag::printError

Reviewed-by: kbarrett, coleenp
This commit is contained in:
Gerard Ziemski 2018-10-03 12:34:22 -05:00
parent 5850a50781
commit db646c699a
4 changed files with 11 additions and 13 deletions

View File

@ -136,7 +136,6 @@ static JVMFlag::Error CMSReservedAreaConstraintFunc(const char* name, size_t val
return JVMFlag::VIOLATES_CONSTRAINT;
}
}
return JVMFlag::SUCCESS;
}
@ -151,12 +150,11 @@ JVMFlag::Error CMSRescanMultipleConstraintFunc(size_t value, bool verbose) {
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;
}

View File

@ -272,7 +272,7 @@ public:
// 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;
};

View File

@ -94,7 +94,7 @@ JVMFlag::Error AllocatePrefetchDistanceConstraintFunc(intx value, bool verbose)
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::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose)
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 @@ JVMFlag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose)
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 @@ JVMFlag::Error RTMTotalCountIncrRateConstraintFunc(int value, bool verbose) {
#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);
}

View File

@ -42,8 +42,8 @@ JVMFlag::Error ObjectAlignmentInBytesConstraintFunc(intx value, bool verbose) {
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 @@ JVMFlag::Error BiasedLockingStartupDelayFunc(intx value, bool verbose) {
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 @@ JVMFlag::Error PerfDataSamplingIntervalFunc(intx value, bool verbose) {
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 {