Subject: bin/48: Minor lint stuff in yacc output fixed
To: None <gnats-admin>
From: None <tholo@SigmaSoft.COM>
List: netbsd-bugs
Date: 12/21/1993 02:05:06
>Number:         48
>Category:       bin
>Synopsis:       Minor lint stuff in yacc output fixed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 21 02:05:04 1993
>Originator:     Thorsten Lockert
>Organization:
Thorsten Lockert  | postmaster@bbb.no   |
Postbox 435       | hostmaster@bbb.no   |  Universe, n.:
N-5001 Bergen     | tholo@bbb.no        |          The problem.
Norway            | tholo@sigmasoft.com |
>Release:        0.9-current
>Environment:
    	
System: NetBSD gandalf.bbb.no 0.9a GANDALF#9 i386


>Description:
	A label in the generated grammer would never be used,
	removed.
	Extra set of parentesises around assignment in an if-
	statement to make lint happy
	Use prototype decl. of yyparse() if defined(__STDC__)
>How-To-Repeat:
	Run 'gcc -Wall' on yacc output
	Note that yyerrlab will be used if the YYERROR statement
	has been used in the grammar, and thus cannot be removed.
	It is also properly handled by lint
>Fix:
*** /usr/src/usr.bin/yacc/skeleton.c.orig	Tue Dec 21 10:44:49 1993
--- /usr/src/usr.bin/yacc/skeleton.c		Tue Dec 21 10:46:55 1993
***************
*** 82,88 ****
--- 82,92 ----
      "#define YYACCEPT goto yyaccept",
      "#define YYERROR goto yyerrlab",
      "int",
+     "#if defined(__STDC__)",
+     "yyparse(void)",
+     "#else",
      "yyparse()",
+     "#endif",
      "{",
      "    register int yym, yyn, yystate;",
      "#if YYDEBUG",
***************
*** 106,112 ****
      "    *yyssp = yystate = 0;",
      "",
      "yyloop:",
!     "    if (yyn = yydefred[yystate]) goto yyreduce;",
      "    if (yychar < 0)",
      "    {",
      "        if ((yychar = yylex()) < 0) yychar = 0;",
--- 110,116 ----
      "    *yyssp = yystate = 0;",
      "",
      "yyloop:",
!     "    if ((yyn = yydefred[yystate]) != 0) goto yyreduce;",
      "    if (yychar < 0)",
      "    {",
      "        if ((yychar = yylex()) < 0) yychar = 0;",
***************
*** 146,155 ****
      "        goto yyreduce;",
      "    }",
      "    if (yyerrflag) goto yyinrecovery;",
-     "#ifdef lint",
-     "    goto yynewerror;",
-     "#endif",
-     "yynewerror:",
      "    yyerror(\"syntax error\");",
      "#ifdef lint",
      "    goto yyerrlab;",
--- 150,155 ----
>Audit-Trail:
>Unformatted:

------------------------------------------------------------------------------