From tim@X3000  Thu Jun 20 12:29:25 1996
Received: from X3000 (ppp1654.on.sympatico.ca [206.172.249.118])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id MAA02991
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 20 Jun 1996 12:28:34 -0700 (PDT)
Received: (from root@localhost) by X3000 (8.7.5/8.7.3) id BAA01232; Thu, 20 Jun 1996 01:18:45 -0400 (EDT)
Message-Id: <199606200518.BAA01232@X3000>
Date: Thu, 20 Jun 1996 01:18:45 -0400 (EDT)
From: Tim.Vanderhoek@X3000 (ac199@freenet.hamilton.on.ca)
Reply-To: ac199@freenet.hamilton.on.ca
To: FreeBSD-gnats-submit@freebsd.org
Subject: yacc-generated parser generates a warning with -Wall
X-Send-Pr-Version: 3.2

>Number:         1337
>Category:       bin
>Synopsis:       Yacc skeleton parser generates warning with -Wall
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 20 12:30:01 PDT 1996
>Closed-Date:    Mon Sep 16 19:00:53 PDT 1996
>Last-Modified:  Mon Sep 16 19:01:38 PDT 1996
>Originator:     Tim Vanderhoek
>Release:        FreeBSD 2.2-960501-SNAP i386
>Organization:
League of the BYacc-Worshippers
>Environment:

	There's a desk, with false wood on top..yunno, the kind that's
really a photograph-like-thing, and stairs a little to my left, but 
they're not very high (only 3 steps).  It looks like they lead to
the kitchen.

>Description:

	Compiling a yacc-generated parser with -Wall will generate the
warning:

y.tab.c:999: warning: suggest parenthesis around assignment used as truth value

>How-To-Repeat:

	See Description.

>Fix:
	
The following patch is relevant to -current as of date shown,


*** skeleton.c	Thu Jun 20 01:03:41 1996
--- oldskel.c	Thu Jun 20 01:07:01 1996
***************
*** 145,151 ****
      "    *yyssp = yystate = 0;",
      "",
      "yyloop:",
!     "    if ((yyn = yydefred[yystate])) goto yyreduce;",
      "    if (yychar < 0)",
      "    {",
      "        if ((yychar = yylex()) < 0) yychar = 0;",
--- 145,151 ----
      "    *yyssp = yystate = 0;",
      "",
      "yyloop:",
!     "    if (yyn = yydefred[yystate]) goto yyreduce;",
      "    if (yychar < 0)",
      "    {",
      "        if ((yychar = yylex()) < 0) yychar = 0;",
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: alex 
State-Changed-When: Mon Sep 16 19:00:53 PDT 1996 
State-Changed-Why:  
Fixed in revision 1.4 of skeleton.c. 

Thanks to Steve Price <sprice@hiwaay.net> for pointing this out. 

>Unformatted:
