This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
warning: conflicting types for built-in function %qD
- From: Matt Austern <austern at apple dot com>
- To: gcc mailing list <gcc at gcc dot gnu dot org>
- Date: Mon, 14 Feb 2005 11:28:35 -0800
- Subject: warning: conflicting types for built-in function %qD
In the C front end, when diagnose_mismatched_decls sees a declaration
of a function whose name is the same as a builtin's but whose types are
different, we use the declaration we see but we issue a warning. For
example:
[isolde:tmp]$ cat foo.c
extern double scalb ( double, int );
[isolde:tmp]$ /work/root.apple/bin/gcc -c foo.c
foo.c:1: warning: conflicting types for built-in function 'scalb'
This warning is unconditional. As you can see from the above example,
we don't even need -Wall to see it. The only way to turn it off, in
fact, is to use the heavy-handed -w.
What was the rationale behind issuing this warning? I find it rather
unfriendly. In this example, after all, the user isn't doing anything
wrong. scalb is not defined in any standard that I can see, and users
have every right to declare a function called scalb with whatever types
they like.
Earlier versions of the compiler did not issue this warning, and the
C++ front end still doesn't. I'd like to see this warning removed, or
at the very least tamed.
--Matt