RFR: 8360177: ParallelArguments::initialize has incorrect format string

Thomas Schatzl tschatzl at openjdk.org
Mon Jun 23 07:10:31 UTC 2025


On Mon, 23 Jun 2025 01:30:27 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> Please review this trivial fix to a jio_fprintf format string. It should be using
> "%zu" to print values of type uintx, rather than using "%d".
> 
> Testing: mach5 tier1
> Locally tested with gcc printf warnings enabled for jio_fprintf, and verified
> the warnings for the changed call are no longer present.

Changes requested by tschatzl (Reviewer).

src/hotspot/share/gc/parallel/parallelArguments.cpp line 73:

> 71:       if (FLAG_IS_CMDLINE(MinSurvivorRatio)) {
> 72:         jio_fprintf(defaultStream::error_stream(),
> 73:           "Inconsistent MinSurvivorRatio vs InitialSurvivorRatio: %zu vs %zu\n", MinSurvivorRatio, InitialSurvivorRatio);

Should probably use `UINTX_FORMAT` instead.

-------------

PR Review: https://git.openjdk.org/jdk/pull/25926#pullrequestreview-2948909222
PR Review Comment: https://git.openjdk.org/jdk/pull/25926#discussion_r2160873780


More information about the hotspot-gc-dev mailing list