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.
- From: Gerald Pfeifer <gerald at pfeifer dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, David O'Brien <obrien at freebsd dot org>,kan at freebsd dot org
- Date: Mon, 21 Jul 2003 09:32:42 +0200 (CEST)
- Subject: Re: [PATCH] Clean-up C's builtin function type matching.
- References: <Pine.LNX.4.44.0307201456530.21889-100000@www.eyesopen.com>
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;
}
Plain gcc issues
x.c:1: warning: built-in function `exp' declared as non-function
and gcc -Wshadow issues
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
all of which I have been told are wrong as long as <math.h> hasn't been
#included.
Would you mind having a look at this?
Gerald