On Mon, 6 Jan 2025 13:44:27 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:
>> src/hotspot/share/ci/ciFlags.cpp line 95: >> >>> 93: // ciFlags::print >>> 94: void ciFlags::print(outputStream* st) { >>> 95: st->print(" flags=%x", _flags.as_unsigned_short()); >> >> Here, and elsewhere, are we relying on an implicit widening of the u2 result >> to int so that the format specifier is correct? > > Yes, we are. I had a little experiment. extern "C" int printf(const char *,...); int main() { unsigned short ss = 0x8000; printf("does unsigned sign extend to int? %d\n", int(ss)); } ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22246#discussion_r1904172191