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
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Devang Patel <dpatel at apple dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>, Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Date: Wed, 23 Feb 2005 02:36:18 +0000 (UTC)
- Subject: Re: warning: conflicting types for built-in function %qD
- References: <3033B889-6F3B-48BE-84AE-B5E84A71CD5D@apple.com>
On Tue, 22 Feb 2005, Devang Patel wrote:
> Would it be OK, if this warnings are disabled for system headers ?
What is the built-in function involved and what (and why) is the different
system header type? Is this a case where a system reuses a nonstandard
name GCC has built in for an entirely different purpose?
We already are meant to have some laxity in matching the types of built-in
functions to those of system header declarations (to allow both for
pre-ISO-C systems and for not knowing within GCC what type FILE is).
Disabling this warning for system headers may well make sense - but it
would lead to users getting / not getting the built-in according to
whether the particular translation unit happened to include that header,
so I'd like to understand the actual problem.
I think the fact that a warning is disabled in a system header is testable
in the gcc.dg testsuite: have a .c file include a .h file, the .h file
containing the offending declaration after #pragma GCC system_header.
This test should fail before your patch and pass afterwards. What you
can't so readily test in such testcases is for diagnostics that are
*meant* to appear in the system header, as DejaGnu seems only to look at
dg-error/dg-warning annotations in the main file and interprets all line
numbers in diagnostics as referring to the main file without regard to the
file named in the diagnostic.
--
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)