NetBSD Problem Report #48
From gnats Tue Dec 21 02:04:46 1993
Received: from gandalf.bbb.no (gandalf.bbb.no [192.124.156.194]) by sun-lamp.cs.berkeley.edu (8.6.4/8.6.4) with ESMTP id CAA05358 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Tue, 21 Dec 1993 02:01:48 -0800
Message-Id: <199312211001.LAA01814@gandalf.bbb.no>
Date: Tue, 21 Dec 1993 11:01:38 +0100
From: tholo@SigmaSoft.COM
Reply-To: tholo@SigmaSoft.COM
To: gnats-bugs@sun-lamp.cs.berkeley.edu
Subject: Minor lint stuff in yacc output fixed
X-Send-Pr-Version: 3.01.6
>Number: 48
>Category: bin
>Synopsis: Minor lint stuff in yacc output fixed
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: gnats-admin
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Dec 21 02:05:04 +0000 1993
>Closed-Date: Fri Jan 07 11:17:28 +0000 1994
>Last-Modified:
>Originator: Thorsten Lockert
>Release: 0.9-current
>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 |
>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 ----
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback
State-Changed-By: jtc
State-Changed-When: Tue Dec 21 10:45:43 1993
State-Changed-Why:
I've applied the enclosed fix.
State-Changed-From-To: feedback->closed
State-Changed-By: jtc
State-Changed-When: Fri Jan 7 11:17:28 1994
State-Changed-Why:
I've received no feedback from the submitter, but all of my tests
confirm that this enhancement works as expected.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.