JDK-8310537 : Fix -Wconversion warnings in gcUtil.hpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-06-21
  • Updated: 2023-07-12
  • Resolved: 2023-06-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b04Fixed
Related Reports
Relates :  
Relates :  
Description
There are -Wconversion warnings in gcUtil.hpp/cpp for mostly double to float conversions.  The code mostly uses float for AdaptiveWeightedAverage and other statistics but some functions in LinearLeastSquareFit return double.

Changing some of the returns from the slope() functions and a few float casts turns off -Wconversion warnings:

2028 src/hotspot/share/gc/shared/gcUtil.hpp
6 src/hotspot/share/gc/shared/gcUtil.cpp

The reason for so many is that the file is included several times (ie it's only a small number of warnings).
Comments
Changeset: d91d0d30 Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2023-06-23 15:57:16 +0000 URL: https://git.openjdk.org/jdk/commit/d91d0d3011b878e47b937981896fed0b2be30362
23-06-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14585 Date: 2023-06-21 12:16:54 +0000
21-06-2023