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

Dean Long dlong at openjdk.org
Thu Aug 10 21:48:58 UTC 2023


On Thu, 10 Aug 2023 15:22:07 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.

src/hotspot/os/linux/os_linux.cpp line 3204:

> 3202:       for (int j = 0; j < cpu_map_valid_size; j++) {
> 3203:         if (cpu_map[j] != 0) {
> 3204:           for (int k = 0; k < BitsPerCLong; k++) {

For changes to lines 3145 to 3204, wouldn't it be better to keep using size_t?

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

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


More information about the hotspot-dev mailing list