RFR: 8312121: Fix -Wconversion warnings in tribool.hpp [v5]
David Holmes
dholmes at openjdk.org
Thu Jul 27 22:31:52 UTC 2023
On Thu, 27 Jul 2023 14:11:48 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Assigning _value first, and then doing _value | 2 doesn't get -Wconversion warnings. Also, reduced include file inclusion a little.
>> Tested with tier1 on linux-x64-debug, windows-x64-debug, macos-aarch64-debug
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>
> Back to V1.
Maybe somewhere a comment could be added like:
// Update _value in two steps to avoid awkward casts needed to silence conversion warnings
otherwise someone is bound to rewrite those two lines as one at some point in the future.
Thanks.
src/hotspot/share/utilities/tribool.hpp line 44:
> 42: TriBool() : _value(0) {}
> 43: TriBool(bool value) : _value(value) {
> 44: _value = _value | 2; // set to not-default
Why not `|=` here?
-------------
Marked as reviewed by dholmes (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/14892#pullrequestreview-1550935419
PR Review Comment: https://git.openjdk.org/jdk/pull/14892#discussion_r1276877688
More information about the hotspot-dev
mailing list