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

Fix -Wconversion warnings in tribool.hpp

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 22
    • 22
    • hotspot
    • b09

    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]




      Attachments

        Issue Links

          Activity

            People

              coleenp Coleen Phillimore
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: