RFR(S) 8204294: [REDO] - JVMFlag::printError missing ATTRIBUTE_PRINTF
Kim Barrett
kim.barrett at oracle.com
Sat Sep 15 21:11:28 UTC 2018
> On Sep 14, 2018, at 1:40 PM, Gerard Ziemski <gerard.ziemski at oracle.com> wrote:
>
> Hi all,
>
> Please review this redo of a simple fix that adds ATTRIBUTE_PRINTF to "JVMFlag::printError” and also fixes the resulting mismatch format errors that it triggers (as it is supposed to).
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8204294
> Webrev: http://cr.openjdk.java.net/~gziemski/8204294_rev1/index.html
> Testing: Mach5 hs_tier1,2,3,4,5,6 (completed successfully)
>
>
> Cheers
------------------------------------------------------------------------------
src/hotspot/share/gc/cms/jvmFlagConstraintsCMS.cpp
153 "a multiple of " INT32_FORMAT "\n",
HeapWordSize is of type int. Use %d directly, rather than
INT32_FORMAT.
------------------------------------------------------------------------------
src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp
97 "between 0 and %d\n",
98 AllocatePrefetchDistance, 512);
Why is this hard-coding the 0 but not 512 in the string. Or better,
make 512 a named constant and replace both uses here.
Or even better, why is this a constraint function at all? Couldn't
this apparently platform-generic restriction just be a range
constraint, e.g. range(-1, 512)?
------------------------------------------------------------------------------
src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp
147 JVMFlag::Error OnStackReplacePercentageConstraintFunc(intx value, bool verbose) {
The clauses being changed are only reachable via a narrowing
conversion, which has implementation-defined value. Fixing that is
probably out of scope for this change.
------------------------------------------------------------------------------
src/hotspot/share/runtime/flags/jvmFlagConstraintsCompiler.cpp
398 "RTMTotalCountIncrRate (" INT32_FORMAT
RTMTotalCountIncrRate is of type int. Use %d directly, rather than
INT32_FORMAT.
------------------------------------------------------------------------------
Have you checked for uses of printError() in code specific to platforms
not tested by Oracle?
More information about the hotspot-runtime-dev
mailing list