bug-bison
[Top][All Lists]
Advanced

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

Re: Bison >1.31 miscompiles the modutils 2.4.16


From: Akim Demaille
Subject: Re: Bison >1.31 miscompiles the modutils 2.4.16
Date: 04 Jun 2002 12:28:05 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter)

>>>>> "Mike" == Mike Castle <address@hidden> writes:

>> URL please!

Mike> Oops.  Forgot it.

Mike> 
ftp://ftp.kernel.org/pub/linux/utils/kernel/modutils/v2.4/modutils-2.4.16.tar.gz

Well, then it's easy to see what happens:


gcc -O2 -Wall -Wno-uninitialized -I. -I. -I./../include -D_GNU_SOURCE  
-DCONFIG_ROOT_CHECK_OFF=0   -c -o parse.o parse.c
parse.y: In function `yyparse':
parse.y:191: parse error before `}'
parse.y:192: parse error before `}'

and line 191 is:

        | EXTERN_KEYW   { is_extern = 1; $$ = $1 }
        | INLINE_KEYW   { is_extern = 0; $$ = $1 }

as you can see, the actions have no ending `;', so the code is not
proper C.  Bison used to put a trailing `;', but people complained
about this doubtfull feature (as, in particular, Bison was the only
Yacc to behave this way).

So, fix the sources!  You'll also gain Bison independence.

Changes in version 1.31, 2002-01-14:

[....]

* User Actions
  Bison has always permitted actions such as { $$ = $1 }: it adds the
  ending semicolon.  Now if in Yacc compatibility mode, the semicolon
  is no longer output: one has to write { $$ = $1; }.


In forthcoming 2.0 (or whatever the name), the trailing `;' is never
output.  This is because, unfortunately, many people use bison -y in
the Makefiles, i.e., ask for the Yacc behavior, so the `transition
scheme' is quite useless.



reply via email to

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