This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Clean-up C's builtin function type matching.
On Mon, Jul 21, 2003 at 06:32:01PM +1000, Fergus Henderson wrote:
> On 21-Jul-2003, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> > On Sun, 20 Jul 2003, Roger Sayle wrote:
> > > Continuing in my current run of improvements to GCC's builtin function
> > > handling, the following patch tidies up the fuzzy type checking code
> > > for builtin functions in the C front-end's duplicate_decls.
> >
> > That's really a coincidence, seeing this patch after just discussing a
> > related issue with the FreeBSD guys who just updated their system compiler
> > to GCC 3.3 and experienced a regression. ;-)
> >
> > Consider the following program:
> >
> > extern int exp;
> >
> > int main() {
> > int sin=1;
> > return sin+exp;
> > }
...
> > x.c:1: warning: built-in function `exp' declared as non-function
> > x.c: In function `main':
> > x.c:4: warning: declaration of `sin' shadows a global declaration
> > <built-in>:0: warning: shadowed declaration is here
...
> The warnings about `sin' are a bit more debatable. Arguably it is bad
> style to use the name of a standard C function as the name of a local
> variable, if the relevant header file isn't included. So whether this
> change to the behaviour of -Wshadow is a regression or a progression is
> in the eyes of the beholder.
Lets just address this point for the moment -- ignoring 'exp'. The
FreeBSD community feels this is indead a regression.
--
-- David (obrien@FreeBSD.org)