Subject: bin/1402: yacc(1) declares the yydebug variable when YYDEBUG is not defined
To: None <gnats-bugs@gnats.netbsd.org>
From: Thorsten Lockert <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 08/23/1995 00:15:49
>Number:         1402
>Category:       bin
>Synopsis:       yacc(1) declares the yydebug variable when YYDEBUG is not defined
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 23 03:20:04 1995
>Last-Modified:
>Originator:     Thorsten Lockert
>Organization:
SigmaSoft
>Release:        August 22, 1995
>Environment:
System: NetBSD gandalf.sigmasoft.com 1.0A NetBSD 1.0A (GANDALF) #0: Thu Jul 6 14:32:54 PDT 1995 tholo@gandalf.sigmasoft.com:/usr/src/sys/arch/i386/compile/GANDALF i386

>Description:
	yacc(1) declares the global variable yydebug regardless of wether
	or not YYDEBUG is #define'd.  This results in warnings from lint(1)
	as well as waste memory.

>How-To-Repeat:
	Run lint(1) on a parser generated by YACC.

>Fix:
	Apply the following patch:

*** src/usr.bin/yacc/skeleton.c.orig	Wed Aug 23 00:15:07 1995
--- src/usr.bin/yacc/skeleton.c	Tue Aug 22 21:35:47 1995
***************
*** 60,66 ****
--- 60,68 ----
      "#define YYMAXDEPTH 500",
      "#endif",
      "#endif",
+     "#if YYDEBUG",
      "int yydebug;",
+     "#endif",
      "int yynerrs;",
      "int yyerrflag;",
      "int yychar;",
>Audit-Trail:
>Unformatted: