RFR: 8313564: Fix -Wconversion warnings in classfile code [v2]
David Holmes
dholmes at openjdk.org
Wed Aug 2 23:34:15 UTC 2023
On Wed, 2 Aug 2023 19:19:15 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/classfile/symbolTable.cpp line 933:
>>
>>> 931: tty->print_cr(" Total symbol length " SIZE_FORMAT_W(7), hi.total_length);
>>> 932: tty->print_cr(" Maximum symbol length " SIZE_FORMAT_W(7), hi.max_length);
>>> 933: tty->print_cr(" Average symbol length %7.2f", ((float)hi.total_length / (float)hi.total_count));
>>
>> Same here
>
> I think each value needs to be cast to get the correct result.
Yes size_t values must be cast to float/double. Again I think double should be used here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1282503088
More information about the hotspot-dev
mailing list