RFR: 8361086: JVMCIGlobals::check_jvmci_flags_are_consistent has incorrect format string

Kim Barrett kbarrett at openjdk.org
Mon Jun 30 22:50:40 UTC 2025


On Mon, 30 Jun 2025 17:21:20 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

> Or we can cast it to (int). Or we can change flag's declaration to `int` type.

I think it's better to change the format string than to cast the value.  If we
later change the value type we'll (hopefully by then) get an appropriate
warning about needing to change the format string again. Adding a cast now
becomes a useless or otherwise confusing cast (that is hard to find, because
that's the nature of casts) after a change of type.

I tried changing the type of the option to int and that got messy, because
there are a number of places that are accessing it by name from Java as an
intx, such as using WhiteBox::getIntxVMFlag. I wasn't entirely confident I'd
found all of them, since I was getting into unfamiliar code.

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

PR Comment: https://git.openjdk.org/jdk/pull/26051#issuecomment-3021070917


More information about the hotspot-compiler-dev mailing list