bug-groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #61964] deprecated-enum-float-conversion in dvi.cpp, color.cpp, and


From: Bjarni Ingi Gislason
Subject: [bug #61964] deprecated-enum-float-conversion in dvi.cpp, color.cpp, and ps.cpp
Date: Sat, 29 Jan 2022 19:05:47 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?61964>

                 Summary: deprecated-enum-float-conversion in dvi.cpp,
color.cpp, and  ps.cpp
                 Project: GNU troff
            Submitted by: bjarniig
            Submitted on: Sun 30 Jan 2022 12:05:45 AM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Build/Installation
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None

    _______________________________________________________

Details:

Subject: deprecated-enum-float-conversion in dvi.cpp, color.cpp, and
 ps.cpp

Files: 

src/devices/grodvi/dvi.cpp
src/libs/libgroff/color.cpp
src/devices/grops/ps.cpp

  Warnings when compiled with "-std=c++20" (gcc (Debian 11.2.0-14)
11.2.0).


  An example for "dvi.cpp":

  CXX      src/devices/grodvi/dvi.o
../src/devices/grodvi/dvi.cpp: In member function 'void
dvi_printer::set_color(color*)':
../src/devices/grodvi/dvi.cpp:319:30: warning: arithmetic between
floating-point type 'double' and enumeration type 'color::<unnamed enum>' is
deprecated [-Wdeprecated-enum-float-conversion]
  319 |                  double(Red) / color::MAX_COLOR_VAL,
      |                  ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

---End example---

  Other lines are 320-321, 328-331, 335, and 697.

  An example for "color.cpp":

  CXX      src/libs/libgroff/libgroff_a-color.o
../src/libs/libgroff/color.cpp: In member function 'char*
color::print_color()':
../src/libs/libgroff/color.cpp:376:25: warning: arithmetic between
floating-point type 'double' and enumeration type 'color::<unnamed enum>' is
deprecated [-Wdeprecated-enum-float-conversion]
  376 |             double(Red) / MAX_COLOR_VAL,
      |             ~~~~~~~~~~~~^~~~~~~~~~~~~~~

---End example---

  Other lines are 377-378, 382-384, 388-391, and 395.

  For "ps.cpp":

  CXX      src/devices/grops/ps.o
../src/devices/grops/ps.cpp: In member function 'ps_output&
ps_output::put_color(unsigned int)':
../src/devices/grops/ps.cpp:374:34: warning: arithmetic between floating-point
type 'double' and enumeration type 'color::<unnamed enum>' is deprecated
[-Wdeprecated-enum-float-conversion]
  374 |   sprintf(buf, "%.3g", double(c) / color::MAX_COLOR_VAL);
      |                        ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61964>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]