RFR: 8313564: Fix -Wconversion warnings in classfile code [v4]

Dean Long dlong at openjdk.org
Thu Aug 3 19:50:47 UTC 2023


On Thu, 3 Aug 2023 12:07:27 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/cpu/x86/vm_version_x86.cpp line 1808:
>> 
>>> 1806: 
>>> 1807:   // Allocation prefetch settings
>>> 1808:   int cache_line_size = checked_cast<int>(prefetch_data_size());
>> 
>> I don't see why the old code would produce a warning, except with -Wsign-conversion on 32-bit platforms.
>
> I put the cast in because prefetch_data_size() returns uint and I'm narrowing it to int which has a lower positive range.  I assume checked_cast would find that.

OK, so you caught it by inspection and are fixing it proactively :-)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15111#discussion_r1283649276


More information about the graal-dev mailing list