RFR: 8313554: Fix -Wconversion warnings for ResolvedFieldEntry
Matias Saavedra Silva
matsaave at openjdk.org
Thu Aug 3 16:18:31 UTC 2023
On Thu, 3 Aug 2023 11:48:43 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> src/hotspot/share/oops/resolvedFieldEntry.hpp line 106:
>>
>>> 104: void set_flags(bool is_final, bool is_volatile) {
>>> 105: int new_flags = (is_final << is_final_shift) | static_cast<int>(is_volatile);
>>> 106: _flags = (u1)new_flags;
>>
>> Why isn't this using checked_cast?
>
> I still don't see the point of using checked_cast if we know that this is only two bits.
As far as I've designed it, only the last two bits of the flags are ever set or used. C++ booleans are either 0 or 1 so the higher bits should never be set.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15126#discussion_r1283432290
More information about the build-dev
mailing list