This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
PATCH: don't warn about types defined in casts for sys headers
- To: gcc-bugs at gcc dot gnu dot org
- Subject: PATCH: don't warn about types defined in casts for sys headers
- From: Brendan Kehoe <brendan at zen dot org>
- Date: Wed, 08 Nov 2000 20:12:47 +0000
- Reply-To: Brendan Kehoe <brendan at zen dot org>
This does a change I actually made some months ago, but forgot to
submit. In
a system package from a random vendor, they chose to implement something by
way of a type defined inside a cast. Since those headers were not available
for quick fixing, it seemed instead to carry forward into this check the
idea
that we shouldn't bitch about what systems (not users) have chosen to do.
Ok?
B
2000-11-08 Brendan Kehoe <brendan@zen.org>
* typeck2.c (check_for_new_type): Don't warn about defining types
within a cast (et al.) if it's coming from a system header.
Index: typeck2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/typeck2.c,v
retrieving revision 1.89
diff -u -p -r1.89 typeck2.c
--- typeck2.c 2000/10/20 20:23:11 1.89
+++ typeck2.c 2000/11/08 16:59:04
@@ -1219,6 +1219,7 @@ check_for_new_type (string, inptree)
flagged_type_tree inptree;
{
if (inptree.new_type_flag
+ && !in_system_header
&& (pedantic || strcmp (string, "cast") != 0))
pedwarn ("ISO C++ forbids defining types within %s", string);
}
--
Brendan Kehoe
CTO of Nobie.com (http://www.nobie.com/)
-- Finally true Net marketing in .ie