svn commit: r254626 - stable/9/usr.bin/yacc
Dag-Erling Smørgrav
des at des.no
Thu Aug 22 11:56:18 UTC 2013
Bruce Evans <brde at optusnet.com.au> writes:
> Dag-Erling Smørgrav <des at des.no> writes:
> > Oh, it's actually our own fault for including -Wredundant-decls in
> > CFLAGS. Is there a good reason to keep it?
> How else would you detect bogus declarations of library functions? Almost
> all -W flags are for detecting bugs that are mostly style bugs like this
> one. This one only becomes more than a style bug if:
> - the declaration becomes wrong
> - the header with the correct declaration becomes not included.
OK, point taken.
> Another bug in the commit is that it auto-generates code with a style
> bug (redundant extern). yacc in -current seems to auto-generate a
> function prototype for just one function (the same one), and this has
> the style bug too. This may be needed for K&R1 version compilers from
> 1978, but not for the STDC case.
I noticed that as well.
So what do you suggest? Revert David's change, or keep it (minus
extern) and remove the prototype from expr.y?
I favor the latter option, since yyparse() is auto-generated and expr.y
can therefore (strictly speaking) not know what the correct prototype
looks like.
DES
--
Dag-Erling Smørgrav - des at des.no
More information about the svn-src-stable-9
mailing list