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]

Re: Mail delivery failed: returning message to sender


On Mon, Jul 17, 2000 at 12:20:00PM -0700, Zack Weinberg wrote:
> On Mon, Jul 17, 2000 at 12:01:58PM -0700, H . J . Lu wrote:
> > With gcc in CVS on 20000716,
> > 
> > # work/build/gnu/bin/gcc-3.0-libstdc++v3/gcc/testsuite/../g++ -B/work/build/gnu/bin/gcc-3.0-libstdc++v3/gcc/testsuite/../  -E -I.  -ansi -pedantic-errors t.cc > /dev/null
> > In file included from t.cc:1:
> > t.h:2:2: ISO C does not allow #include_next
> 
> I am looking into this bug right now.  Please be patient.

This is not a bug; the 'system_header' pragma is no longer available
in the compatibility namespace.  You must write

#pragma GCC system_header

libstdc++v3 needs to update its headers to match.  For discussion,
please see the threads beginning with:

http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00694.html
http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00748.html

I've now added a test case for this feature.

zw

	* gcc.dg/cpp/syshdr.c: New test.
	* gcc.dg/cpp/syshdr1.h, gcc.dg/cpp/syshdr2.h: New files.

===================================================================
Index: testsuite/gcc.dg/cpp/syshdr.c
--- testsuite/gcc.dg/cpp/syshdr.c	Tue May  5 13:32:27 1998
+++ testsuite/gcc.dg/cpp/syshdr.c	Mon Jul 17 12:46:33 2000
@@ -0,0 +1,12 @@
+/* Test for proper suppression of warnings in system headers,
+   and only in system headers.  */
+/* FRAGILITY WARNING: The only way we have to distinguish the good error
+   from the bad error is that the good error is on line 4 and the bad is
+   on line 5 (of their respective files).  dg.exp doesn't have any way to
+   condition error matchers on the file they're in.  */
+
+/* { dg-do preprocess } */
+/* { dg-error "include_next" "good error" { target *-*-* } 4 } */
+
+#include "syshdr1.h"  /* { dg-error "" "In file included from:" } */
+#include "syshdr2.h"
===================================================================
Index: testsuite/gcc.dg/cpp/syshdr1.h
--- testsuite/gcc.dg/cpp/syshdr1.h	Tue May  5 13:32:27 1998
+++ testsuite/gcc.dg/cpp/syshdr1.h	Mon Jul 17 12:46:33 2000
@@ -0,0 +1,4 @@
+/* This file should generate an error because #include_next is not a
+   standard directive.  */
+
+#include_next <stdio.h>
===================================================================
Index: testsuite/gcc.dg/cpp/syshdr2.h
--- testsuite/gcc.dg/cpp/syshdr2.h	Tue May  5 13:32:27 1998
+++ testsuite/gcc.dg/cpp/syshdr2.h	Mon Jul 17 12:46:33 2000
@@ -0,0 +1,5 @@
+/* This file would generate an error because of #include_next, but the
+   #pragma marks it a system header, so the error is suppressed.  */
+
+#pragma GCC system_header
+#include_next <stdio.h>

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