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

David Holmes dholmes at openjdk.org
Tue Jan 24 00:25:14 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.

I tested the `using jubyte = std::make_unsigned<jbyte>::type`  version and it caused problems.

macOS:

open/src/hotspot/share/services/diagnosticArgument.cpp:315:45: error: format specifies type 'unsigned long long *' but the argument has type 'u8 *' (aka 'unsigned long *') [-Werror,-Wformat]
int res = sscanf(str, UINT64_FORMAT "%c", &_value._val, &_value._multiplier);

and Windows:

 c:\sb\prod\1674512381\workspace\open\src\hotspot\share\jfr\recorder\checkpoint\jfrCheckpointManager.cpp(472): error C2664: 'size_t write_thread_checkpoint_payloads(JfrChunkWriter &,const u1 *,size_t,u4 &)': cannot convert argument 4 from 'uint32_t' to 'u4 &'

so I'm guessing the `using` directive establishes a different namespace for these types and they aren't considered to match the standard ones - even if the same size and signedness.

As Kim and Coleen both approved this as-is I will integrate this simple cleanup version and leave conversion from typedef to a future RFE if that is deemed desirable.

Thanks.

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

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


More information about the hotspot-dev mailing list