RFR: 8311575: Fix invalid format parameters [v2]

Kim Barrett kbarrett at openjdk.org
Fri Jul 7 07:46:01 UTC 2023


On Fri, 7 Jul 2023 06:42:11 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> Please review this change that fixes a few issues with printf-like function parameters.
>> 
>> No new tests. I'll run tier1 & tier2 before integrating, just to make sure.
>
> Daniel Jeliński has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add newlines

A couple pre-existing indentation nits, but otherwise looks good.

src/hotspot/os/windows/perfMemory_windows.cpp line 225:

> 223:       // unexpected error, declare the path insecure
> 224:       if (PrintMiscellaneous && Verbose) {
> 225:         warning("could not get attributes for file %s: ",

Too bad ATTRIBUTE_PRINTF is empty for Windows.  Visual Studio doesn't seem to be an equivalent to
gcc's `__attribute__((format(printf(...)))`.

src/hotspot/share/runtime/arguments.cpp line 2841:

> 2839:           if (strncmp(jvmci_compiler, "graal", strlen("graal")) != 0) {
> 2840:             jio_fprintf(defaultStream::error_stream(),
> 2841:               "Value of jvmci.Compiler incompatible with +UseGraalJIT: %s", jvmci_compiler);

[pre-existing] Unusual indentation.

src/hotspot/share/runtime/arguments.cpp line 2858:

> 2856:         if (!JVMCIGlobals::enable_jvmci_product_mode(origin, use_graal_jit)) {
> 2857:           jio_fprintf(defaultStream::error_stream(),
> 2858:             "Unable to enable JVMCI in product mode");

[pre-existing] Unusual indentation.

src/hotspot/share/runtime/arguments.cpp line 3951:

> 3949:   if (lvl == NMT_unknown) {
> 3950:     jio_fprintf(defaultStream::error_stream(),
> 3951:                 "Syntax error, expecting -XX:NativeMemoryTracking=[off|summary|detail]", nullptr);

This would have been caught already if JDK-8198918 had been fixed.

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

Marked as reviewed by kbarrett (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14783#pullrequestreview-1518088854
PR Review Comment: https://git.openjdk.org/jdk/pull/14783#discussion_r1255388370
PR Review Comment: https://git.openjdk.org/jdk/pull/14783#discussion_r1255344865
PR Review Comment: https://git.openjdk.org/jdk/pull/14783#discussion_r1255344723
PR Review Comment: https://git.openjdk.org/jdk/pull/14783#discussion_r1255371424


More information about the hotspot-dev mailing list