This is the mail archive of the gcc-patches@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 for compilation of selectbits.h with C++ code


If you compile a file containing

   #include <socketbits.h>

and include the -pedantic-errors flag, you'll find it says

    In file included from t.C:1:
    /usr/include/socketbits.h:173: ANSI C++ forbids zero-size array `__cmsg_data'

This makes the compiler recognize that it can't complain about system headers
doing such stuff.

B

1999-10-06  Brendan Kehoe  <brendan@cygnus.com>

	* decl.c (grokdeclarator): Only warn about non-zero arrays if
	!in_system_header (linux socketbits.h can give this for __cmsg_data).

Index: decl.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/cp/decl.c,v
retrieving revision 1.479
diff -u -p -r1.479 decl.c
--- decl.c	1999/10/05 16:19:02	1.479
+++ decl.c	1999/10/06 12:16:41
@@ -9883,7 +9883,7 @@ grokdeclarator (declarator, declspecs, d
 			      dname);
 		    size = integer_one_node;
 		  }
-		if (pedantic && integer_zerop (size))
+		if (pedantic && !in_system_header && integer_zerop (size))
 		  cp_pedwarn ("ANSI C++ forbids zero-size array `%D'", dname);
 		if (TREE_CONSTANT (size))
 		  {


-- 
Brendan Kehoe

Web page: http://www.zen.org/~brendan/


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