RFR: 8313302: Fix formatting errors on Windows [v3]
Thomas Stuefe
stuefe at openjdk.org
Fri Jul 28 10:34:51 UTC 2023
On Fri, 28 Jul 2023 10:06:01 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> src/hotspot/os/windows/osThread_windows.hpp line 30:
>>
>>> 28: typedef void* HANDLE;
>>> 29: public:
>>> 30: typedef unsigned int thread_id_t;
>>
>> Since Windows is LLP64, this has no effect, even though beginthreadex returns an unsigned int.
>
> It's also another formatting change, as this is printed as %d in shared code. This also matches the definition of int on other platforms. This should functionally be harmless, because ints are promoted to longs (DWORD) whenever thread_id_t is passed to a callee that expects a DWORD, and since longs are the same size as ints this is effectively an implicit cast with no effect in those cases
I can live with this change. Its also small and isolated.
>> src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp line 422:
>>
>>> 420: st->print(", RBX=0x%016llx", uc->Rbx);
>>> 421: st->print(", RCX=0x%016llx", uc->Rcx);
>>> 422: st->print(", RDX=0x%016llx", uc->Rdx);
>>
>> Why?
>
> All of these are either DWORD64 or DWORD, none are actually intptr_t's or uintptr_t's
In that case UINT64_FORMAT_X would be more correct. But again, unless there is an important reason to do so, I would leave changing this to when someone changes/moves around the code.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15063#discussion_r1277382451
PR Review Comment: https://git.openjdk.org/jdk/pull/15063#discussion_r1277384588
More information about the graal-dev
mailing list