🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #578

db_yyerror should be compiled only if YYDEBUG is nonzero

#578
From: Paul Eggert
Date: Tue, 14 Nov 1989 02:23
27 lines
1044 bytes
Some versions of bison generate yytname[] only if YYDEBUG is nonzero.
But db_yyerror() in cplus-parse.y always references yytname[].
db_yyerror() is needed only in debugging situations,
so it might as well depend on YYDEBUG too.  Here is a fix.

*** old/cplus-parse.y	Mon Nov 13 18:16:14 1989
--- new/cplus-parse.y	Mon Nov 13 16:10:10 1989
***************
*** 2991,2996 ****
--- 2991,2997 ----
  
  %%
  
+ #if YYDEBUG != 0
  db_yyerror (s, yyps, yychar)
       char *s;
       short *yyps;
***************
*** 3028,3033 ****
--- 3029,3035 ----
      }
  #endif
  }
+ #endif
  
  void
  yyerror (string)
Technical Details
Message-ID: <8911140223.AA01982@rise.twinsun.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!twinsun.com!eggert

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!twinsun.com!eggert
From: eggert@twinsun.com (Paul Eggert)
Newsgroups: gnu.g++.bug
Subject: db_yyerror should be compiled only if YYDEBUG is nonzero
Message-ID: <8911140223.AA01982@rise.twinsun.com>
Date: 14 Nov 89 02:23:32 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 27