🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #1168

Minor bug in bison version 1.19

#1168
From: u90jl
Date: Sun, 13 Dec 1992 22:22
61 lines
2171 bytes
If %semantic_parser is not being used and debugging is switched off
(with YYDEBUG unset), yyrhs is output unnecessarily.  I discovered this
when compiling such an output file with "gcc -Wall", which gave me a
warning that yyrhs was not being used.

When yyprhs and yyrhs are output by bison (in output.c), yyprhs is
surrounded by a "#if YYDEBUG != 0", "#endif" pair.  The fix is to move
the #endif down so yyrhs can also by #if'd out when necessary.

Patch follows.

Jamie

p.s. What does %semantic_parser do anyway?  I'm sure I've seen this
     asked before, but I haven't seen a reply.  Perhaps someone could
     give me a reference to look up?
-------------------------------------------------------------------------------
*** output.c	Sat Apr 18 23:18:38 1992
--- output.c	Sun Dec 13 22:07:23 1992
***************
*** 315,321 ****
    register int j;
    register short *sp;
  
!   /* With the ordinary parser, yyprhs is needed only for yydebug.  */
    if (!semantic_parser)
      fprintf(ftable, "\n#if YYDEBUG != 0");
  
--- 315,321 ----
    register int j;
    register short *sp;
  
!   /* With the ordinary parser, yyprhs and yyrhs are needed only for yydebug. */
    if (!semantic_parser)
      fprintf(ftable, "\n#if YYDEBUG != 0");
  
***************
*** 341,349 ****
  
    fprintf(ftable, "\n};\n");
  
-   if(!semantic_parser)
-     fprintf(ftable, "\n#endif\n");
- 
    fprintf(ftable, "\nstatic const short yyrhs[] = {%6d", ritem[0]);
  
    j = 10;
--- 341,346 ----
***************
*** 368,373 ****
--- 365,373 ----
      }
  
    fprintf(ftable, "\n};\n");
+ 
+   if(!semantic_parser)
+     fprintf(ftable, "#endif\n");
  }
  
  
-------------------------------------------------------------------------------
Technical Details
Message-ID: <9212132222.AA04247@booth2.ecs.ox.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ecs.ox.ac.UK!u90jl

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!ecs.ox.ac.UK!u90jl
From: u90jl@ecs.ox.ac.UK
Subject: Minor bug in bison version 1.19
Message-ID: <9212132222.AA04247@booth2.ecs.ox.ac.uk>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Sun, 13 Dec 1992 22:22:48 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 62