bugGNU troff - Bugs: bug #61450, Add warning for extraneous...

 
 

bug #61450: Add warning for extraneous arguments to requests

Submitter:  Ralph Corderoy <ralph>
Submitted:  Tue 09 Nov 2021 11:39:37 AM UTC
 
Category:  Core Severity:  1 - Wish
Item Group:  Warning/Suspicious behaviour Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       No canned response available

 

Sat 04 Jun 2022 01:12:52 AM UTC, comment #3: 

original submission:

> Conversation causing this bug report occurred on the groff
> mailing list in 2021-11 under the subject ‘Two trivial questions’.


For easy clicking, the relevant thread starts at http://lists.gnu.org/r/groff/2021-11/msg00043.html

Another aspect has occurred to me since that thread: I wonder if the present behavior is by design, much like how unrecognized macros are silently (by default) ignored.

The advantage of such leniency is that a document designed for a more-featured roff can be processed by a less-featured one, with perhaps some loss of fidelity but otherwise intact.  For example, a document prepared for groff might use the .tkf request to adjust letterspacing, but could still be processed with a historical roff that lacks this request; the desired letterspacing would of course not be reflected, but the document would largely render fine otherwise.

Similarly, groff's .ss request takes two parameters, but this is an extension to CSTR#54 troff, where it took only one.  But thanks to the lack of parameter-count checking, a two-parameter .ss will be handled without complaint by a CSTR#54-only troff, with only slight changes in sentence spacing to show for it.

So if, down the road, some future groff 1.28 expands the .po request to take two additional optional parameters, documents that use this expanded functionality can still run without error on groff 1.23, just missing whatever bells and whistles 1.28 added.

This isn't an argument against such warnings being activable with the proper switch (as undefined-macro warnings currently are), but it's possibly an argument against their being on by default, and probably an argument against one day upgrading the condition to an error.

Dave <barx>
Project Member
Tue 11 Jan 2022 04:06:39 AM UTC, comment #2: 

Moving back to former Item Group.  Sorry for the churn.

G. Branden Robinson <gbranden>
Project Administrator
Sun 14 Nov 2021 12:02:40 AM UTC, comment #1: 

This might be as simple as adding a conditional to `skip_line()`.

`token::next()` already takes care of escape sequence processing, so comments still work as documented.

So do other escape sequences.  Here are some interesting things you can do today, though I don't recall seeing any input that exploits the rules this aggressively.

$ cat EXPERIMENTS/post-request-funny-business.groff
.ft R \R'a 5'
.ps 10 \s'24z'
.tm a=\na, .ps=\n[.ps]u
$ groff EXPERIMENTS/post-request-funny-business.groff
a=5, .ps=24000u

G. Branden Robinson <gbranden>
Project Administrator
Tue 09 Nov 2021 11:39:37 AM UTC, original submission:  

No warning is issued when a request has extraneous arguments, e.g. ‘.ce 3 1 4 1 5’.  A warning should be added and included in the ‘all’ grouping of warnings.  Experience from deploying that warning will allow a future choice on whether extraneous arguments should be upgraded to an error, e.g. there's no widespread historical habit of extra arguments being provided knowing that they'll be ignored.

Conversation causing this bug report occurred on the groff mailing list in 2021-11 under the subject ‘Two trivial questions’.

Ralph Corderoy <ralph>

 

(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 barx (Posted a comment)
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by ralph (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-11 gbranden Item GroupFeature change Warning/Suspicious behaviour
    2022-01-11 gbranden Item GroupWarning/Suspicious behaviour Feature change
    2021-11-14 gbranden Severity3 - Normal 1 - Wish

    Back to the top


    Powered by Savane 3.9