bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bison against GCC -Wundef: one report, and one patch


From: Gerald Pfeifer
Subject: Re: bison against GCC -Wundef: one report, and one patch
Date: Fri, 2 May 2003 21:59:58 +0200 (CEST)

On Mon, 28 Apr 2003, Paul Eggert wrote:
>> 1.875 is quite broken when used with any version of GCC I have available
> Hmm, which GCC versions are those?  It works for me GCC (3.2.2).

With a GCC 3.4 CVS version (i.e., mainline GCC):

  parser2.c: In function `int yyparse()':
  parser2.c:3726: error: expected primary-expression
  parser2.c:3726: error: expected `;'
  parser2.c:3721: warning: label `yyerrlab1' defined but not used

which is the following snippet:

       yyerrlab1:

       /* Suppress GCC warning that yyerrlab1 is unused when no action
          invokes YYERROR.  */
  3726 #if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + 
__GNUC_MINOR__)
  3727   __attribute__ ((__unused__))
  3728 #endif

And with GCC 3.2.2, for the same snippet:

  parser2.c: In function `int yyparse()':
  parser2.c:3730: parse error before `goto'
  parser2.c:3721: warning: label `yyerrlab1' defined but not used

Ahh, I just realize why you probably don't see this problem: I'm compiling
this with g++, not gcc, which had worked for all versions of GCC and all
(other) versions of Bison I have used for the last 8 years.

> Regardless, perhaps we should bump the priority of getting the next
> Bison release out.

Yes, please. ;-)

> The current test version (1.875a) does not have the __attribute__
> ((__unused__)) problem, if you'd like to test that in the meantime.

I did that, and can confirm that indeed it fixes the problem!

(Any chance to make this bison 1.876 or something, so that FreeBSD and
possibly others can use this in their ports collection, given the g++
related problem with 1.875?)

Gerald
-- 
Gerald "Jerry"   address@hidden   http://www.pfeifer.com/gerald/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]