RFR: 8313564: Fix -Wconversion warnings in classfile code [v2]
David Holmes
dholmes at openjdk.org
Wed Aug 2 23:34:11 UTC 2023
On Wed, 2 Aug 2023 18:57:46 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:
>> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Missed a case that gets -Wconversion warning for ContendedPaddingWidth. prefetch_data_size() returns uint, so added a checked_cast<> to catch the case where it would return greater than signed int max.
>
> src/hotspot/share/classfile/symbolTable.cpp line 926:
>
>> 924: if (_symbols_counted > 0) {
>> 925: tty->print_cr(" Percent removed %3.2f",
>> 926: ((float)_symbols_removed / (float)_symbols_counted) * 100);
>
> I think you can also just cast once here.
These should probably be double rather than float - the float result will be promoted to double to be passed as an argument anyway.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1282502783
More information about the graal-dev
mailing list