bugGNU roff - Bugs: bug #67604, [troff] compiler warning regarding...

 
 

bug #67604: [troff] compiler warning regarding hidden overloaded virtual member function

Submitter:  G. Branden Robinson <gbranden>
Submitted:  Tue 14 Oct 2025 02:05:30 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Build/Installation Status:  Duplicate
Privacy:  Public Assigned to:  barx
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Jump to the original submission

Wed 15 Oct 2025 12:03:40 AM UTC, comment #6: 

comment #5:

>   I reported the warning about "virtual bool" in #65885


(Clickably (in Savannah), that's bug #65885.)

Good catch.  Closing this one as a dup.

Dave <barx>
Group Member
Tue 14 Oct 2025 10:10:20 PM UTC, comment #5: 

original submission:

> 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


  I reported the warning about "virtual bool" in #65885

Bjarni Ingi Gislason <bjarniig>
Tue 14 Oct 2025 06:01:06 PM UTC, comment #4: 


comment #2:

> It gets much farther but then it chokes on missing AFM files in connection with creating the URW files which are now found as per our previous exchange. The ghostscript package does not contain any *.afm files. It is a warning message like this:
>
> BuildFoundries: warning: line 119: cannot locate AFM file for font 'U-ZD'
>
> and then right after make(1) stops with an error.


Ah, that issue is probably better discussed back in bug #65974.
 

> I guess it is not worth supporting the ghostscript package on Arch, since it does not contain the required files?


Does some alternative package contain them, maybe?

Please follow-up to bug #65974.

G. Branden Robinson <gbranden>
Group administrator
Tue 14 Oct 2025 05:50:19 PM UTC, comment #3: 

Alternatively, here's my "slow" build script that doesn't go bonkers with compiler options.

(file #57720)

G. Branden Robinson <gbranden>
Group administrator
Tue 14 Oct 2025 05:50:15 PM UTC, comment #2: 

It gets much farther but then it chokes on missing AFM files in connection with creating the URW files which are now found as per our previous exchange. The ghostscript package does not contain any *.afm files. It is a warning message like this:

BuildFoundries: warning: line 119: cannot locate AFM file for font 'U-ZD'

and then right after make(1) stops with an error.

I guess it is not worth supporting the ghostscript package on Arch, since it does not contain the required files?

Morten Bo Johansen <mortenbo>
Tue 14 Oct 2025 03:21:47 PM UTC, comment #1: 

Morten,

In the meantime, if you delete the CFLAGS and CXXFLAGS variable definitions and re-run the script, does the build run to completion?

G. Branden Robinson <gbranden>
Group administrator
Tue 14 Oct 2025 02:05:30 PM UTC, original submission:  

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

G. Branden Robinson <gbranden>
Group administrator

 

Attached Files

Attached Files
file #57720:  make-groff added by gbranden (1.6KiB - application/octet-stream)

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by bjarniig (Posted a comment)
  • -email is unavailable- added by mortenbo (Posted a comment)
  • -email is unavailable- added by gbranden (Submitted the item)
  • -email is unavailable- added by gbranden (original reporter)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

    History

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2025-10-15 barx StatusNeed Info Duplicate
        Assigned toNone barx
        Open/ClosedOpen Closed
    2025-10-14 gbranden Attached File- Added make-groff, #57720
    2025-10-14 gbranden StatusIn Progress Need Info
        Assigned togbranden None
    2025-10-14 gbranden Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.16-598c.
    Corresponding source code