Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jun 1996 01:18:45 -0400 (EDT)
From:      Tim.Vanderhoek@X3000 (ac199@freenet.hamilton.on.ca)
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/1337: yacc-generated parser generates a warning with -Wall
Message-ID:  <199606200518.BAA01232@X3000>
Resent-Message-ID: <199606201930.MAA03085@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         1337
>Category:       bin
>Synopsis:       Yacc skeleton parser generates warning with -Wall
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 20 12:30:01 PDT 1996
>Last-Modified:
>Originator:     Tim Vanderhoek
>Organization:
League of the BYacc-Worshippers
>Release:        FreeBSD 2.2-960501-SNAP i386
>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;",
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606200518.BAA01232>