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

Dean Long dlong at openjdk.org
Thu Aug 10 22:02: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/systemMemoryBarrier_linux.cpp line 59:

> 57: };
> 58: 
> 59: static int64_t membarrier(int cmd, unsigned int flags, int cpu_id) {

Seems OK, but if syscall returns `long` then intrptr_t seems a better fit for 32-bit platforms.  Or we could narrow to int here, as long as membarrier (and futex) aren't returning pointers or memory addresses.

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

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


More information about the hotspot-dev mailing list