This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: conflicting types for built-in function %qD
On Mon, 14 Feb 2005, Gabriel Dos Reis wrote:
> But the program at issue does not invoke anything having to do with
> POSIX, it makes no sense to pretend it has undefined behaviour.
The GNU C dialect, which is the default, includes various built-in
functions from POSIX as well as various other miscellaneous built-in
functions.
> There is a difference between "abs" and "scalb".
One difference is incidental and historical - which GCC versions had which
built-in functions. The other - which are present in a given standard -
is now visible in builtins.def but not in the DECLs themselves.
If we resurrect some form of DECL_BUILT_IN_NONANSI to distinguish them in
the DECLs - and only warn for redeclarations of standard functions - we
should make sure there is still a warning for
int f(long double x) { return signbitl(x); }
long signbitl(void);
which calls a non-standard built-in function (where the type of the
implicit declaration is compatible with that of the built-in function)
then redeclares the function with an incompatible type: such
redeclarations should be diagnosed if the built-in function has already
been called in the translation unit.
--
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
jsm@polyomino.org.uk (personal mail)
joseph@codesourcery.com (CodeSourcery mail)
jsm28@gcc.gnu.org (Bugzilla assignments and CCs)