Integrated: 8313882: Fix -Wconversion warnings in runtime code

Coleen Phillimore coleenp at openjdk.org
Thu Aug 10 12:26:28 UTC 2023


On Mon, 7 Aug 2023 12:57:35 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> Here are fixes to silence -Wconversion warnings in runtime code.  Use direct cast for 64 bit int to double, otherwise default to checked_cast<>.  I changed the declaration of _held_monitor_count and _jni_monitor count to intx to fix cascade of warnings coming from this.
> 
> src/hotspot/share/runtime/synchronizer.cpp:1802:41: warning: conversion from 'intx' {aka 'long int'} to 'int' may change value [-Wconversion]
>  1802 |     _thread->dec_held_monitor_count(rec + 1);
>       |                                     ~~~~^~~
> 
> Tested with tier1-4 on linux-x64-debug and windows-x64-debug and tier1 on Oracle supported platforms.

This pull request has now been integrated.

Changeset: f47767ff
Author:    Coleen Phillimore <coleenp at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/f47767ffef29c777e2da0262fa3299564d59f461
Stats:     138 lines in 26 files changed: 3 ins; 9 del; 126 mod

8313882: Fix -Wconversion warnings in runtime code

Reviewed-by: pchilanomate, dlong, dholmes

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

PR: https://git.openjdk.org/jdk/pull/15177


More information about the graal-dev mailing list