RFR: 8286775: Remove identical per-compiler definitions of unsigned integral jtypes
David Holmes
dholmes at openjdk.org
Tue Jan 24 22:12:12 UTC 2023
On Tue, 24 Jan 2023 16:03:24 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Trivial update to share the common typedef's.
>>
>> Testing:
>> - Oracle tier 1 - 5 builds
>> - GHA (TBD)
>>
>> Thanks.
>
> `using` declarations are intended to be permitted by the Style Guide. (I know
> what I intended when I wrote the relevant part.) It seems that's ambiguous
> though. The Style Guide has this:
>
> * Template aliases (n2258)
>
> That paper also introduced the term "alias declaration", for a non-templated
> `using` type declaration. So the Style Guide should probably say "Alias
> declarations and template aliases".
>
> `using Foo = xxx` is equivalent to `typedef xxx Foo`. The former can be easier
> to read, as it's easier to find the identifier being declared, esp. when the
> `xxx` part is long and complex and perhaps even multi-line.
>
> But I understand the consistency with surrounding code argument.
>
> `std::make_unsigned` is in <type_traits>, which we're allowed to use. But I
> don't think it's really helpful in this case for readability. We know what the
> representation for these is, since the signed types are defined by the Java
> language.
>
> Also, the compilation failures are a result of using `std::make_unsigned`.
> I'm not feeling like digging into exactly why.
Thanks for the additional explanations @kimbarrett !
-------------
PR: https://git.openjdk.org/jdk/pull/12136
More information about the hotspot-dev
mailing list