bugGNU roff - Bugs: bug #60260, [troff] spurious warning about...

 
 

bug #60260: [troff] spurious warning about unbalanced "el" request

Submitter:  None
Submitted:  Fri 19 Mar 2021 04:00:48 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  Duplicate
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 07 Apr 2024 05:18:32 AM UTC, comment #8: 

Thanks, Dave.  You're right.  Updating Summary.

G. Branden Robinson <gbranden>
Group administrator
Sun 07 Apr 2024 05:07:27 AM UTC, comment #7: 

comment #6:

> To the extent that this ticket claims an incompatibility between
> AT&T troff and GNU troff, it is invalid.


The ticket didn't claim that until two days ago.  Its summary for its first three years was "Incorrect warnings of dangling .el with bracket-less nesting", which is either valid or not depending on where you come down on the debate in #65474.

> To the extent that it claims that GNU troff's `el` warning can
> be misleading, I agree; but it is then a duplicate of bug #65474.


That being the complaint originally filed, I've changed the resolution to Duplicate.

Dave <barx>
Group Member
Sun 07 Apr 2024 03:32:32 AM UTC, comment #6: 

Let us port the specimen in comment #0 to AT&T troff.


$ cat EXPERIMENTS/60260a.roff
.de XX
.  tm --- XX called with '\\$1' ---
.  ie '\\$1'a' .tm CASE a
.  el .ie '\\$1'b' .tm CASE b
.  el .ie '\\$1'c' .tm CASE c
.  el .tm Got something else (\\$1)
..
.XX a
.XX b
.XX c
.XX d


...and observe the output of DWB 3.3 nroff, Heirloom Doctools nroff, and GNU nroff.


$ ~/groff-stable/bin/nroff EXPERIMENTS/60260a.roff # 1.23.0
--- XX called with 'a' ---
CASE a
--- XX called with 'b' ---
CASE b
--- XX called with 'c' ---
CASE c
--- XX called with 'd' ---
Got something else (d)
$ cd ~/dwb && DWBHOME=. ./bin/nroff 60260a.roff
--- XX called with 'a' ---
CASE a
--- XX called with 'b' ---
CASE b
--- XX called with 'c' ---
CASE c
--- XX called with 'd' ---
Got something else (d)
$ cd ~/heirloom && ./bin/nroff 60260a.roff
--- XX called with 'a' ---
CASE a
--- XX called with 'b' ---
CASE b
--- XX called with 'c' ---
CASE c
--- XX called with 'd' ---
Got something else (d)


...and for grins, Solaris 10 nroff...


bash-3.2$ nroff 60260a.roff
--- XX called with 'a' ---
CASE a
--- XX called with 'b' ---
CASE b
--- XX called with 'c' ---
CASE c
--- XX called with 'd' ---
Got something else (d)


So none of these formatters exhibit distinguishable flow of control.

To the extent that this ticket claims an incompatibility between AT&T troff and GNU troff, it is invalid.

To the extent that it claims that GNU troff's `el` warning can be misleading, I agree; but it is then a duplicate of bug #65474.  That is indeed a later-filed ticket, but it has a meatier discussion.

Jim Avera noted most of this 3 years ago in comment #1.

So I'm resolving this one as invalid.

G. Branden Robinson <gbranden>
Group administrator
Fri 05 Apr 2024 02:59:03 PM UTC, comment #5: 

My comment #4 is not illustrative of a groff/AT&T compatibility issue.

What it illustrates is AT&T's line counter being wrong, and me not reading the output carefully enough.


$ cat EXPERIMENTS/ie.roff
.ie \nA .tm line 1 (\n(.c), A=\nA
.el .ie \nB .tm line 2 (\n(.c), B=\nB
.el .tm line 3 (\n(.c), A=\nA, B=\nB
.el .tm line 4 (\n(.c), A=\nA, B=\nB
.el .tm line 5 (\n(.c), A=\nA, B=\nB
$ ./build/test-groff -ww -T ascii EXPERIMENTS/ie.roff
troff:EXPERIMENTS/ie.roff:1: warning: register 'A' not defined
troff:EXPERIMENTS/ie.roff:2: warning: register 'B' not defined
line 3 (3), A=0, B=0
troff:EXPERIMENTS/ie.roff:4: warning: unbalanced 'el' request
troff:EXPERIMENTS/ie.roff:5: warning: unbalanced 'el' request
$ cd ~/heirloom/
$ ./bin/nroff ie.roff
line 3 (2), A=0, B=0
$ cd ~/dwb
$ DWBHOME=. ./bin/nroff ie.roff
line 3 (2), A=0, B=0


G. Branden Robinson <gbranden>
Group administrator
Thu 04 Apr 2024 09:28:02 PM UTC, comment #4: 

Sorry, I'll read (write) that again (my "verbatim" tags were maladjusted)...

We have a compatibility issue here.

Exhibit:


.ie \nA .tm line \n(.c, A=\nA
.el .ie \nB .tm line \n(.c, B=\nB
.el .tm line \n(.c, A=\nA, B=\nB
.el .tm line \n(.c, A=\nA, B=\nB
.el .tm line \n(.c, A=\nA, B=\nB


All of Unix V7 nroff and troff, DWB nroff, and Heirloom nroff produce the following output.


$ nroff ie.roff
line 2, A=0, B=0


But then...


$ ~/groff-1.22.3/bin/nroff -ww -rA0 -rB0 ./EXPERIMENTS/ie.roff
line 3, A=0, B=0
./EXPERIMENTS/ie.roff:4: warning: unbalanced .el request
./EXPERIMENTS/ie.roff:5: warning: unbalanced .el request


groff 1.22.4, 1.23.0, and Git HEAD behave the same.

See also bug #65474 and bug #59434.  These are related but distinct and none needs to be closed as a duplicate.

G. Branden Robinson <gbranden>
Group administrator
Thu 04 Apr 2024 12:00:58 PM UTC, comment #3: 

We have a compatibility issue here.

Exhibit:


.ie \nA .tm line \n(.c, A=\nA
.el .ie \nB .tm line \n(.c, B=\nB
.el .tm line \n(.c, A=\nA, B=\nB
.el .tm line \n(.c, A=\nA, B=\nB
.el .tm line \n(.c, A=\nA, B=\nB
+verbatim+

All of Unix V7 nroff and troff, DWB nroff, and Heirloom nroff produce the following output.

+verbatim+
$ nroff ie.roff
line 2, A=0, B=0


But then...


$ ~/groff-1.22.3/bin/nroff -ww -rA0 -rB0 ./EXPERIMENTS/ie.roff
line 3, A=0, B=0
./EXPERIMENTS/ie.roff:4: warning: unbalanced .el request
./EXPERIMENTS/ie.roff:5: warning: unbalanced .el request


groff 1.22.4, 1.23.0, and Git HEAD behave the same.

Merging bug #65474 with this.

G. Branden Robinson <gbranden>
Group administrator
Sat 20 Mar 2021 07:31:57 PM UTC, comment #2: 

The referenced email-list thread begins at http://lists.gnu.org/archive/html/groff/2021-03/msg00015.html.

Later in the thread, Tadziu suggests that the warnings are legitimate.  If so, this situation should probably be documented better, since it's somewhat nonintuitive.  (Bug #59434 also concerns documenting a surprising "unbalanced .el request" warning.)

Dave <barx>
Group Member
Fri 19 Mar 2021 04:13:41 PM UTC, comment #1: 

Forgot to mention that the conditionals work correctly in spite of the warnings.

The code also works correctly on Heirloom Doctools nroff, according to Branden's test (with an example tweaked to not use gnu extended syntax).

So the groff warning is probably incorrect.

Jim Avera <jimav>
Fri 19 Mar 2021 04:00:48 PM UTC, original submission:  

The code below warns about "unbalanced .el request" if either the first or second condition is true (with -w all).

The warnings do not happen if the "else" statements are wrapped in \{\ ... \} but the brackets are not supposed to be necessary, according to Branden Robinson (in a reply to a question on the -email is unavailable- email list). 

Branden also noted that bug https://savannah.gnu.org/bugs/?45502 might be related.

#!/bin/sh
groff -w all >/dev/null <<'EOF'
.de mymac
.  tm1 "--- mymac called with '\\$1' ---
.  ie '\\$1'a' .tm1 "  CASE a
.  el .ie '\\$1'b' .tm1 "  CASE b
.  el .ie '\\$1'c' .tm1 "  CASE c
.  el .tm1 "  Got something else (\\$1)
..
.mymac a
.mymac b
.mymac c
.mymac d
EOF

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Updated the item)
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by jimav (Posted a comment)
  • -email is unavailable- added by jimav
  •  

    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.

     

    Follow 11 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-04-07 gbranden Summary[troff] formatter matches `el` requests with `ie` differently than Unix V7, DWB, and Heirloom [troff] spurious warning about unbalanced "el" request
    2024-04-07 barx Item GroupIncorrect behaviour Warning/Suspicious behaviour
        StatusInvalid Duplicate
    2024-04-07 gbranden StatusNone Invalid
        Open/ClosedOpen Closed
    2024-04-05 gbranden StatusConfirmed None
    2024-04-04 gbranden StatusNone Confirmed
        Assigned toNone gbranden
        SummaryIncorrect warnings of dangling .el with bracket-less nesting [troff] formatter matches `el` requests with `ie` differently than Unix V7, DWB, and Heirloom
    2021-04-21 gbranden CategoryNone Core
    2021-03-19 jimav Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code