bugGNU roff - Bugs: bug #54666, [PATCH] pic.ypp: useless rule in...

 
 

bug #54666: [PATCH] pic.ypp: useless rule in parser due to conflicts

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sat 15 Sep 2018 11:03:11 PM UTC
   
 
Category:  Preprocessor pic Severity:  2 - Minor
Item Group:  Build/Installation Status:  Need Info
Privacy:  Public Assigned to:  None
Open/Closed:  Open Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 11 Aug 2021 01:22:03 PM UTC, comment #3: 

Shift/reduce conflicts are common in ambiguous grammars and I'm not surprised that pic has one, especially an old dialect thereof (James Clark's "compatibility sop" annotation).

I don't mind taking the rule out, but we should tell people how to rewrite old pic files that exercise the ambiguity, and for that, we need examples "before" and "after".  We can then write a NEWS item about it.

I'd do it myself but I have tried and failed twice to learn pic.  Something about it doesn't want to mesh with my brain.  So help is needed here.

G. Branden Robinson <gbranden>
Group administrator
Sun 04 Nov 2018 08:01:26 PM UTC, comment #2: 

  I use "bison" (GNU Bison 3.0.4) as the Linux kernel uses that.


Bjarni Ingi Gislason <bjarniig>
Sun 04 Nov 2018 05:33:29 PM UTC, comment #1: 

I don't get the same output, and I'm using gcc 8.2.0 (on Debian testing).

Maybe the issue is the byacc version?


$ byacc -V
byacc - 1.9 20140715



  YACC     src/preproc/pic/pic.cpp
  YACC     src/preproc/refer/label.cpp
byacc: 2 shift/reduce conflicts.
updating src/preproc/pic/pic.output


G. Branden Robinson <gbranden>
Group administrator
Sat 15 Sep 2018 11:03:11 PM UTC, original submission:  


From 78d27b370c61a65ede2c7a8d3bb4c130a729dff3 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Sat, 15 Sep 2018 22:17:13 +0000
Subject: [PATCH] pic.ypp: useless rule in parser due to conflicts

  Output from "make" with gcc-8.2.0:

  YACC     src/preproc/pic/pic.cpp
  YACC     src/preproc/refer/label.cpp
.../groff/src/preproc/pic/pic.ypp:1391.11-1396.17: warning: rule useless in parser due to conflicts [-Wother]
         | ORDINAL LAST object_type relative_path
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  The test seems to be of no concern and may thus be removed.
Otherwise, those who know what this means and is about, should replace
it with a correct test.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
 src/preproc/pic/pic.ypp | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/src/preproc/pic/pic.ypp b/src/preproc/pic/pic.ypp
index 54ff44ab..a09b7ec2 100644
--- a/src/preproc/pic/pic.ypp
+++ b/src/preproc/pic/pic.ypp
@@ -1388,12 +1388,6 @@ path:
                   $$->set_ypath($4);
                 }
         /* The rest of these rules are a compatibility sop. */
-        | ORDINAL LAST object_type relative_path
-                {
-                  lex_warning("'%1%2 last %3' in 'with' argument ignored",
-                              $1, ordinal_postfix($1), object_type_name($3));
-                  $$ = $4;
-                }
         | LAST object_type relative_path
                 {
                   lex_warning("'last %1' in 'with' argument ignored",
--
2.18.0


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

    Date Changed by Updated Field Previous Value => Replaced by
    2021-08-11 gbranden Severity3 - Normal 2 - Minor
    2018-11-04 gbranden StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code