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

Dean Long dlong at openjdk.org
Fri Aug 11 21:07:58 UTC 2023


On Fri, 11 Aug 2023 20:40:28 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This change fixes various -Wconversion warnings from files in the os directories and related, widening types or adding checked_cast<> where narrowing.
>> Tested with tier1 on linux/macosx/windows and tier1-4 on linux-x64-debug, windows-x64-debug.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Put back size_t parameter for print_signal_handlers and add a checked_cast<> future could fix the dll_address_to_x functions.

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);

src/hotspot/os/posix/signals_posix.hpp line 2:

> 1: /*
> 2:  * Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.

This file has no changes currently.

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

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


More information about the hotspot-dev mailing list