RFR: 8286775: Remove identical per-compiler definitions of unsigned integral jtypes

Kim Barrett kbarrett at openjdk.org
Tue Jan 24 16:06:18 UTC 2023


On Mon, 23 Jan 2023 07:42:29 GMT, David Holmes <dholmes 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.

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

PR: https://git.openjdk.org/jdk/pull/12136


More information about the hotspot-dev mailing list