JDK-8313892 : Fix -Wconversion warnings in java.desktop code
  • Type: Enhancement
  • Component: client-libs
  • Affected Version: 22
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2023-08-07
  • Updated: 2023-08-07
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.
Other
tbdUnresolved
Description
If you turn on -Wconversion and off -Werror, some of the warnings that come out are from java.desktop.  We'd like to eventually have this warning for Hotspot code.  Can these warnings be cleaned up?  This is a sample.

src/java.desktop/share/native/libharfbuzz/OT/Layout/GSUB/Ligature.hh:159:16: warning: conversion from 'hb_codepoint_t' {aka 'unsigned int'} to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion]
  159 |     ligGlyph = ligature;
      |                ^~~~~~~~

src/java.desktop/share/native/libharfbuzz/hb-open-type.hh:859:17: warning: conversion from 'unsigned int' to 'uint16_t' {aka 'short unsigned int'} may change value [-Wconversion]
  859 |       arrayZ[i] = *items;
      |       ~~~~~~~~~~^~~~~~~~
src/java.desktop/share/native/libharfbuzz/OT/Layout/GSUB/../../../hb-ot-layout-gsubgpos.hh:2985:27: warning: conversion from 'unsigned int' to 'short unsigned int' may change value [-Wconversion]
 2985 |       c->copy ((HBUINT16) g);
      |                           ^