Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hans-Peter Nilsson <hp@bitrange.com>
To: bug-dejagnu@gnu.org
Cc: gdb-patches@sources.redhat.com
Subject: [RFA:] DejaGNU patch: Change -I to -isystem for testsuite.
Date: Sat, 26 Oct 2002 20:33:00 -0000	[thread overview]
Message-ID: <Pine.BSF.4.44.0210262330040.27841-200000@dair.pair.com> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1640 bytes --]

This patch fixes, for uninstalled newlib targets in a unified
tree, the listed spurious GCC testsuite excess-errors.  They
occur because the supposedly-to-be-installed newlib limits.h
uses #include_next.  That directive makes gcc emit a warning
when used in a non-system-header context.  While that can be
"fixed" for non-installed headers by adding "#pragma GCC
system_header", it shouldn't be needed; it'd be better if gcc
treated it as a system header while running the test-suite.
Done by changing -I to -isystem for include directives for the
test-suite.  The -isystem option has been there since at least
gcc-2.7.2 so it should be safe for all uses.  This patch is
against the sources.redhat.com unified-tree repository but the
patch applied fine (with offset) to the savannah.gnu.org DejaGNU
repository.

FAIL: gcc.dg/c90-intconst-1.c (test for excess errors)
FAIL: gcc.dg/c99-intconst-1.c (test for excess errors)
FAIL: g++.dg/abi/bitfield4.C (test for excess errors)
FAIL: g++.benjamin/bool01.C (test for excess errors)
FAIL: g++.benjamin/p12475.C (test for excess errors)
FAIL: g++.jason/rfg10.C (test for excess errors)

BTW, does anybody have an idea why gcc/testsuite/site.exp is
completely ineffective?  Changing s/-I/-isystem/g in the
site.exp in gcc/Makefile.in has no effect; in fact it doesn't
seem to be used at all.

Ok to commit to sources.redhat.com/dejagnu?

dejagnu:
	* lib/libgloss.exp (newlib_include_flags): Use -isystem, not -I.
	(libio_include_flags, g++_include_flags, libstdc++_include_flags,
	winsup_include_flags): Ditto.
	* doc/user.sgml (Local Config File): Use -isystem, not -I, in
	example.

brgds, H-P

[-- Attachment #2: Type: TEXT/PLAIN, Size: 4549 bytes --]

Index: doc/user.sgml
===================================================================
RCS file: /cvs/src/src/dejagnu/doc/user.sgml,v
retrieving revision 1.2
diff -p -c -u -p -r1.2 user.sgml
--- doc/user.sgml	21 Apr 2002 08:47:03 -0000	1.2
+++ doc/user.sgml	27 Oct 2002 02:35:40 -0000
@@ -879,7 +879,7 @@
       set target_triplet i586-pc-linux-gnulibc1
       set target_alias i586-pc-linux-gnulibc1
       set CFLAGS ""
-      set CXXFLAGS "-I/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libio -I$srcdir/../libg++/src -I$srcdir/../libio -I$srcdir/../libstdc++ -I$srcdir/../libstdc++/stl -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libg++ -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libstdc++"
+      set CXXFLAGS "-isystem /build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libio -isystem $srcdir/../libg++/src -isystem $srcdir/../libio -isystem $srcdir/../libstdc++ -isystem $srcdir/../libstdc++/stl -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libg++ -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../libstdc++"
       append LDFLAGS " -L/build/devo-builds/i586-pc-linux-gnulibc1/gcc/../ld"
       set tmpdir /build/devo-builds/i586-pc-linux-gnulibc1/gcc/testsuite
       set srcdir "${srcdir}/testsuite"
Index: lib/libgloss.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/lib/libgloss.exp,v
retrieving revision 1.9
diff -p -c -u -p -r1.9 libgloss.exp
--- lib/libgloss.exp	26 Sep 2002 09:50:03 -0000	1.9
+++ lib/libgloss.exp	27 Oct 2002 02:35:40 -0000
@@ -159,7 +159,7 @@ proc newlib_include_flags { args } {
 	if { ${newlib_dir} != "" } {
 	    set newlib_dir [file dirname ${newlib_dir}]
 	}
-	return " -I$gccpath/newlib/targ-include -I${newlib_dir}"
+	return " -isystem $gccpath/newlib/targ-include -isystem ${newlib_dir}"
     } else {
 	verbose "No newlib support for this target"
     }
@@ -191,7 +191,7 @@ proc libio_include_flags { args } {
     if { $libio_bin_dir != "" && $libio_src_dir != "" } {
 	set libio_src_dir [file dirname ${libio_src_dir}]
 	set libio_bin_dir [file dirname ${libio_bin_dir}];
-	return " -I${libio_src_dir} -I${libio_bin_dir}"
+	return " -isystem ${libio_src_dir} -isystem ${libio_bin_dir}"
     } else {
 	return ""
     }
@@ -226,22 +226,23 @@ proc g++_include_flags { args } {
 
     set dir [lookfor_file ${srcdir} libg++]
     if { ${dir} != "" } {
-	append flags " -I${dir} -I${dir}/src"
+	append flags " -isystem ${dir} -isystem ${dir}/src"
     }
 
     set dir [lookfor_file ${srcdir} libstdc++-v3]
     if { ${dir} != "" } {
-	append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++"
+	append flags " -isystem ${dir}/include -isystem ${dir}/include/std"
+	append flags " -isystem ${dir}/include/c_std -isystem ${dir}/libsupc++"
     }
 
     set dir [lookfor_file ${gccpath} libstdc++-v3]
     if { ${dir} != "" } {
-	append flags " -I${dir}/include -I${dir}/include/${target_alias}"
+	append flags " -isystem ${dir}/include -isystem ${dir}/include/${target_alias}"
     }
 
     set dir [lookfor_file ${srcdir} libstdc++]
     if { ${dir} != "" } {
-	append flags " -I${dir} -I${dir}/stl"
+	append flags " -isystem ${dir} -isystem ${dir}/stl"
     }
 
     return "$flags"
@@ -317,19 +318,20 @@ proc libstdc++_include_flags { args } {
 
     set dir [lookfor_file ${srcdir} libstdc++-v3]
     if { ${dir} != "" } {
-	append flags " -I${dir}/include -I${dir}/include/std -I${dir}/include/c_std -I${dir}/libsupc++"
+	append flags " -isystem ${dir}/include -isystem ${dir}/include/std"
+	append flags " -isystem ${dir}/include/c_std -isystem ${dir}/libsupc++"
     }
 
     set gccpath [get_multilibs]
 
     set dir [lookfor_file ${gccpath} libstdc++-v3]
     if { ${dir} != "" } {
-	append flags " -I${dir}/include -I${dir}/include/${target_alias}"
+	append flags " -isystem ${dir}/include -isystem ${dir}/include/${target_alias}"
     }
 
     set dir [lookfor_file ${srcdir} libstdc++]
     if { ${dir} != "" } {
-	append flags " -I${dir} -I${dir}/stl"
+	append flags " -isystem ${dir} -isystem ${dir}/stl"
     }
 
     return "$flags"
@@ -860,7 +862,7 @@ proc winsup_include_flags { args } {
 	set winsup_dir [lookfor_file ${srcdir} winsup/include/windows.h]
 	if { ${winsup_dir} != "" } {
 	    set winsup_dir [file dirname ${winsup_dir}]
-	    return " -I${winsup_dir}"
+	    return " -isystem ${winsup_dir}"
 	}
     }
     verbose "No winsup support for this target"
 

             reply	other threads:[~2002-10-27  3:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-26 20:33 Hans-Peter Nilsson [this message]
2002-11-12 12:38 ` [Bug-dejagnu] " Rob Savoye
2002-11-12 15:17   ` Hans-Peter Nilsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.BSF.4.44.0210262330040.27841-200000@dair.pair.com \
    --to=hp@bitrange.com \
    --cc=bug-dejagnu@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox