RFR: 8313882: Fix -Wconversion warnings in runtime code [v6]
Dean Long
dlong at openjdk.org
Thu Aug 10 00:32:28 UTC 2023
On Thu, 10 Aug 2023 00:13:21 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/runtime/objectMonitor.hpp line 238:
>>
>>> 236: //
>>> 237: #define OM_OFFSET_NO_MONITOR_VALUE_TAG(f) \
>>> 238: ((in_bytes(ObjectMonitor::f ## _offset())) - (int)markWord::monitor_value)
>>
>> Suggestion:
>>
>> ((in_bytes(ObjectMonitor::f ## _offset())) - (intptr_t)markWord::monitor_value)
>
> If this is intptr_t, it'll get a Wconversion warning on the uses that expect int.
OK, in that case checked_cast<int>() would be more correct.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15177#discussion_r1289388423
More information about the hotspot-dev
mailing list