svn commit: r254626 - stable/9/usr.bin/yacc

Bruce Evans brde at optusnet.com.au
Thu Aug 22 11:49:38 UTC 2013


On Thu, 22 Aug 2013, [utf-8] Dag-Erling Smørgrav wrote:

> Dag-Erling Smørgrav <des at des.no> writes:
>> This breaks the build in usr.bin/expr because expr.y already provides a
>> prototype, and gcc does not accept multiple prototypes, even if they're
>> identical.  That is arguably a bug in gcc,

ISTR that it took several rounds of changes to fix the same bug in -current
in expr and many other places.

> Oh, it's actually our own fault for including -Wredundant-decls in
> CFLAGS.  Is there a good reason to keep it?
>
>       -Wredundant-decls
>           Warn if anything is declared more than once in the same scope, even
>           in cases where multiple declaration is valid and changes nothing.

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.

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.

Bruce


More information about the svn-src-stable-9 mailing list