This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/10025: gcc 3.2.2 recognizes complex functions even without complex.h
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Aharon Robbins <arnold at skeeve dot com>
- Cc: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, Richard dot Earnshaw at arm dot com
- Date: Wed, 12 Mar 2003 12:36:15 +0000
- Subject: Re: c/10025: gcc 3.2.2 recognizes complex functions even without complex.h
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
GCC's builtins don't need header files to access them. So it isn't
possible to just disable them by not including a header.
Anyway, there's no need to restrict yourself to ansi C. Simply disable
the conflicting builtin:
$ cat conj.c
int conj (int a, int b);
void f(){}
$ gcc -c conj.c
conj.c:1: warning: conflicting types for built-in function `conj'
$ gcc -c conj.c -fno-builtin-conj
$
> Document it and call it a feature, eh? I think it's a bug; GCC shouldn't
> talk about conflicts with any builtin function if the header file for it
> hasn't been included.
>
> This is pretty sad.
>
> Arnold
>
> > Date: 11 Mar 2003 15:07:13 -0000
> > To: arnold at skeeve dot com, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org,
> > nobody at gcc dot gnu dot org
> > From: bangerth at dealii dot org
> > Reply-To: bangerth at dealii dot org, arnold at skeeve dot com, gcc-bugs at gcc dot gnu dot org,
> > gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
> > Subject: Re: c/10025: gcc 3.2.2 recognizes complex functions even without complex.h
> >
> > Synopsis: gcc 3.2.2 recognizes complex functions even without complex.h
> >
> > State-Changed-From-To: open->closed
> > State-Changed-By: bangerth
> > State-Changed-When: Tue Mar 11 15:07:12 2003
> > State-Changed-Why:
> > This is a gnu extension. The builtin conj function is switched
> > off if you use -ansi or -std=c89.
> >
> > W.
> >
> > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10025