Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Aug 2013 21:49:18 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
Cc:        svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org, "David E. O'Brien" <obrien@FreeBSD.org>
Subject:   Re: svn commit: r254626 - stable/9/usr.bin/yacc
Message-ID:  <20130822213005.H1824@besplex.bde.org>
In-Reply-To: <86y57ugn00.fsf@nine.des.no>
References:  <201308212257.r7LMvUmY053608@svn.freebsd.org> <8638q2i1oo.fsf@nine.des.no> <86y57ugn00.fsf@nine.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--0-597222542-1377172158=:1824
Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 22 Aug 2013, [utf-8] Dag-Erling Sm=C3=B8rgrav wrote:

> Dag-Erling Sm=C3=B8rgrav <des@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 nothin=
g.

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
--0-597222542-1377172158=:1824--



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