Follow-up Comment #5, bug #67604 (group groff): [comment #0 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
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67604>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
