JDK-8312121 : Fix -Wconversion warnings in tribool.hpp
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-07-14
  • Updated: 2023-08-10
  • Resolved: 2023-07-28
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 b09Fixed
Related Reports
Relates :  
Description
There are 450 tribool.hpp Wconversion warnings reported from 3 places when compiling HotSpot.

src/hotspot/share/utilities/tribool.hpp: In constructor 'TriBool::TriBool(bool)':
src/hotspot/share/utilities/tribool.hpp:43:44: warning: conversion from 'unsigned int' to 'unsigned char:2' may change value [-Wconversion]
   43 |   TriBool(bool value) : _value(((u1)value) | 2) {}
      |                                ~~~~~~~~~~~~^~~
src/hotspot/share/utilities/tribool.hpp: In member function 'TriBool& TriBool::operator=(bool)':
src/hotspot/share/utilities/tribool.hpp:47:26: warning: conversion from 'unsigned int' to 'unsigned char:2' may change value [-Wconversion]
   47 |     _value = ((u1)value) | 2;
      |              ~~~~~~~~~~~~^~~
   
src/hotspot/share/utilities/tribool.hpp:76:26: warning: conversion from 'unsigned int' to 'unsigned char:2' may change value [-Wconversion]





Comments
Changeset: 47c4b992 Author: Coleen Phillimore <coleenp@openjdk.org> Date: 2023-07-28 12:08:24 +0000 URL: https://git.openjdk.org/jdk/commit/47c4b992b44a5ce120aa4fe9e01279d4c52bca0a
28-07-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14892 Date: 2023-07-14 19:47:39 +0000
14-07-2023