This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30219] Inconsistent reporting of duplicate typedef
- From: "ross dot alexander at uk dot neceur dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2006 16:56:52 -0000
- Subject: [Bug c/30219] Inconsistent reporting of duplicate typedef
- References: <bug-30219-4285@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from ross dot alexander at uk dot neceur dot com 2006-12-15 16:56 -------
I have found the relevent code in c-decl.c but it would be nice if this emitted
a warning so that if -Wsystem-headers is set then the warning will show up.
Thanks for the assistence.
Ross
/* Redeclaration of a type is a constraint violation (6.7.2.3p1),
but silently ignore the redeclaration if either is in a system
header. (Conflicting redeclarations were handled above.) */
if (TREE_CODE (newdecl) == TYPE_DECL)
{
if (DECL_IN_SYSTEM_HEADER (newdecl) || DECL_IN_SYSTEM_HEADER (olddecl))
return true; /* Allow OLDDECL to continue in use. */
error ("redefinition of typedef %q+D", newdecl);
locate_old_decl (olddecl, error);
return false;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30219