bugGNU roff - Bugs: bug #63011, [troff] spurious warning from...

 
 

bug #63011: [troff] spurious warning from "do_overstrike"

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sun 04 Sep 2022 01:15:49 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Warning/Suspicious behaviour Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.23.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 16 Sep 2022 05:19:54 PM UTC, comment #4: 


commit 9c526ce2243f9326ec43d2220576cd48697e44de
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 13 08:12:56 2022 -0500

    [troff]: Fix Savannah #63011.

    Don't throw a spurious warning when using newline as delimiter with the
    few escape sequences that permit this.

    * src/roff/troff/input.cpp (do_overstrike, do_bracket, do_width)
    (do_special): Do it.

    Fixes <https://savannah.gnu.org/bugs/?63011>.  Thanks to Bjarni Ingi
    Gislason for the report and Dave Kemper for the discussion.

commit 945e98944e571097895ae1a1bcc23db20e04681c
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Tue Sep 13 06:51:08 2022 -0500

    [troff]: Add regression test for Savannah #63011.

    * src/roff/groff/tests/some_escapes_accept_newline_delimiters.sh: Do it.
    * src/roff/groff/groff.am (groff_TESTS): Run it.

    Test fails at this commit (all cases except '\X').


G. Branden Robinson <gbranden>
Group administrator
Tue 13 Sep 2022 11:23:08 AM UTC, comment #3: 

Confirmed.  The warning is spurious.  The documentation is pretty bit-rotted, or maybe started that way, and the logic in src/roff/troff/input.cpp is harder to follow than it needs to be.

Per the source code, four escape sequences permit newlines as delimiters.

I can check three of these against V7 Unix troff behavior, but \X is a device-independent troff innovation.

Interestingly (to me), \X is not documented even in the "Unix 4.0" version of CSTR #54, the earliest documentation of device-independent troff known to date.

https://lists.gnu.org/archive/html/groff/2022-06/msg00033.html

So it is really not clear to me whether it should accept a newline as a delimiter.  But, groff seems to have accepted it basically forever...

I'm working on a fix for the diagnostic messages.

G. Branden Robinson <gbranden>
Group administrator
Mon 05 Sep 2022 06:54:39 PM UTC, comment #2: 

  I made the mistake to use "/usr/bin/groff" without the '-ww' option.

Bjarni Ingi Gislason <bjarniig>
Mon 05 Sep 2022 12:33:26 PM UTC, comment #1: 

Interesting, I don't see any fundamental behavior difference between 1.22.4 and git HEAD here.  In both I get the warning only if warnings are enabled; the only difference is that 1.22.4 emits a terser version:

$ printf '\o\no+\nOne.\n' | groff -ww | wc
troff: <standard input>:2: warning: missing closing delimiter
    236     630    5730


  • If the documentation is correct, there should be no warning.
  • If the documentation is incorrect, and newline is not a valid \o delimiter, the warning should not complain only about its closing delimiter.
  • If the documentation is correct, but based on it recommending against this practice, a warning is emitted, the warning should tell the user "that's a bad idea" rather than "something's missing."


So no matter the situation, the current warning is inaccurate.  Updating Summary accordingly.

Dave <barx>
Group Member
Sun 04 Sep 2022 01:15:49 PM UTC, original submission:  

Subject: troff/input.cpp: wrong(?) warning from "do_overstrike"

File: src/roff/troff/input.cpp

Bug #63002 shows how a newline is a valid delimiter (taken from
paragraph "5.5.3 Escapes" in "groff.info" but is not recommended).

Example

.pl 10v
Overstriking \o
\'o
next word.

GNU groff version 1.22.4 issues no warning, but git HEAD does:

troff: backtrace: file 'prof.overstriking':3
troff:prof.overstriking:3: warning: missing closing delimiter in
overstrike escape sequence (got newline)

Bjarni Ingi Gislason <bjarniig>

 

(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 (Posted a comment)
  • -email is unavailable- added by barx (Posted a comment)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    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 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-16 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2022-09-13 gbranden StatusConfirmed In Progress
        Assigned toNone gbranden
        Planned ReleaseNone 1.23.0
    2022-09-13 gbranden StatusNone Confirmed
        Summarytroff/input.cpp: wrong warning from &quot;do_overstrike&quot; [troff] spurious warning from "do_overstrike"
    2022-09-05 barx Summarytroff/input.cpp: wrong(?) warning from &quot;do_overstrike&quot; troff/input.cpp: wrong warning from "do_overstrike"

    Back to the top

    Powered by Savane 3.13-3cd0.
    Corresponding source code