This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: don't warn about types defined in casts for sys headers


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]