Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8313892

Fix -Wconversion warnings in java.desktop code

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 22
    • client-libs
    • None


      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);
            | ^

            prr Philip Race
            coleenp Coleen Phillimore
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: