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

Dean Long dlong at openjdk.org
Fri Aug 11 21:08:01 UTC 2023


On Fri, 11 Aug 2023 12:39:21 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/os/posix/signals_posix.cpp line 1732:
>> 
>>> 1730:     if (sig > MAX2(SIGSEGV, SIGBUS) &&  // See 4355769.
>>> 1731:         sig < NSIG) {                   // Must be legal signal and fit into sigflags[].
>>> 1732:       PosixSignals::SR_signum = checked_cast<int>(sig);
>> 
>> checked cast seems unnecessary given the range check
>
> I agree but I added it to make other reviewers happy.

An alternative would be to use parse_integer() instead of strtol to get the value as an int.

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

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


More information about the hotspot-dev mailing list