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

                 Summary: [troff] compiler warning regarding hidden overloaded
virtual member function
                   Group: GNU roff
               Submitter: gbranden
               Submitted: Tue 14 Oct 2025 02:05:30 PM UTC
                Category: Core
                Severity: 3 - Normal
              Item Group: Build/Installation
                  Status: In Progress
                 Privacy: Public
             Assigned to: gbranden
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 14 Oct 2025 02:05:30 PM UTC By: G. Branden Robinson <gbranden>
Morten Bo Johansen reported the following problem in bug #65974.


  CXX      src/roff/troff/env.o
In file included from ../src/roff/troff/env.cpp:39:
../src/roff/troff/reg.h:23:16: error: 'virtual bool reg::get_value(units*)'
was hidden [-Werror=overloaded-virtual=]
   23 |   virtual bool get_value(units *);
      |                ^~~~~~~~~
../src/roff/troff/env.cpp:3284:8: note:   by 'bool
unsigned_env_reg::get_value(unsigned int*)'
 3284 |   bool get_value(unsigned int *val);
      |        ^~~~~~~~~
cc1plus: all warnings being treated as errors


Obviously the argument types given to these functions differ.  Which one is
incorrect, or is one missing?

The whole point of the `unsigned_env_reg` class is to store an unsigned value,
and `units` is basically a synonym of (signed) `int`.  I wonder if C/C++'s
loose numeric typing is giving us grief here.

Obligatory remark: We wouldn't have this problem in Ada, which has strict
numeric typing. :P







    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to