URL: <https://savannah.gnu.org/bugs/?67908>
Summary: [troff] warn when numerical expressions have
multiple unary operators in sequence?
Group: GNU roff
Submitter: gbranden
Submitted: Mon 12 Jan 2026 04:13:02 PM UTC
Category: Core
Severity: 1 - Wish
Item Group: Warning/Suspicious behaviour
Status: Need Info
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Unlocked
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Mon 12 Jan 2026 04:13:02 PM UTC By: G. Branden Robinson <gbranden>
[https://cvsweb.bsd.lv/mandoc/term.c?rev=1.295&content-type=text/x-cvsweb-markup&sortby=date
Pointed out by Ingo Schwarze in a recent mandoc commit.]
He spoke of the `ll` request but it's true in general for numeric
expressions.
.nr a +-+-1
.tm a=\na
.nr b +-+2
.tm b=\nb
...reports "a=1" and "b=-2" on GNU, DWB 3.3, Heirloom Doctools, and Plan 9
from User Space _troff_s.
This convention is a little weird.
But, as Ingo points out, it can get weirder when a numeric expression can be
preceded by a unary incrementation or decrementation operator...which happens
to be spelled the same.
Should we:
1. Have the formatter throw a warning when multiple sign operators occur in
sequence?
2. Have the formatter throw a warning when a *crementation operator is
followed by a sign operator?
Nothing seems to be breaking due to this, so setting severity to "wish".
Requesting feedback from the community; setting to "Need Info" status.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?67908>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
