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

David Holmes dholmes at openjdk.org
Fri Aug 11 03:45:00 UTC 2023


On Thu, 10 Aug 2023 19:43:37 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Coleen Phillimore has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>> 
>>  - Dean's suggested changes.
>>  - Merge branch 'master' into os-conversion
>>  - Fix cgroupSubsystem_linux.cpp
>>  - Unset Wconversion for testing.
>>  - Fix signals to take int buflen, fixed return types of syscalls
>>  - Fix attachListener.cpp warnings.
>>  - change send/recv parameter type to match OS.
>>  - Fix -Wconversion warnings in os_linux.
>
> src/hotspot/os/linux/cgroupSubsystem_linux.cpp line 497:
> 
>> 495: 
>> 496:   if (quota > -1 && period > 0) {
>> 497:     quota_count = (int)ceilf((float)quota / (float)period);
> 
> Should be OK except for the pathological case of quota near INT_MAX and period == 1.

Are you concerned that the float representation of INT_MAX/1 could be INT_MAX+epsilon so the ceil function increases it to INT_MAX+1?

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

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


More information about the hotspot-dev mailing list