RFR: 8314114: Fix -Wconversion warnings in os code, primarily linux [v5]

Coleen Phillimore coleenp at openjdk.org
Sat Aug 12 13:42:00 UTC 2023


On Sat, 12 Aug 2023 06:05:48 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

>> src/hotspot/os/linux/os_linux.cpp line 404:
>> 
>>> 402: // thread id is used to access /proc.
>>> 403: pid_t os::Linux::gettid() {
>>> 404:   int64_t rslt = syscall(SYS_gettid);
>> 
>> Suggestion:
>> 
>>   long rslt = syscall(SYS_gettid);
>
> I am in favour of `long` too, since that is what syscall returns. int64_t does not seem to have any obvious relation to the call. And there is no reason to need 64-bit on 32-bit Linux.

We try to avoid using long in the hotspot source code, at least in the shared code since long is a different size on windows.  The preference is to use int64_t.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15229#discussion_r1292279483


More information about the hotspot-dev mailing list