This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: gthr.h: Use include <> instead of include ""
- To: rittle at labs dot mot dot com
- Subject: Re: gthr.h: Use include <> instead of include ""
- From: Andreas Jaeger <aj at suse dot de>
- Date: Thu, 12 Jul 2001 13:58:35 +0200
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <200107100116.f6A1Gln44346@latour.rsch.comm.mot.com>
Loren James Rittle <rittle@latour.rsch.comm.mot.com> writes:
>> gthr.h uses #include "...". IMO system include files should only
>> search in system paths and we should therefore use #include <...> to
>> avoid including user level files.
>
> Yes, the gcc/gthr*.h files are a tricky beast. libstdc++ is the first
> support library to actually install them for use when the user runs
> the related compiler. When other libraries build against those header
> files (e.g. libobjc), they are used only at library construction time
> before installation. However, as you know, C++ libraries are usually
> a mix of header files and compiled library code thus existing
> approaches didn't work (in light of the presumed existing requirement
> that people that configure the library with no threading support must
> not pay overhead costs).
>
>> Unfortunatly the appended patch does not work, bootstrapping of GCC
>> fails for me with this:
>
> [Your patch actually breaks the fragile staging process mentioned
> below. Were you seeing an actual bootstrap failure before your
> patch?]
No - just with that version.
> There are already staging rules in libstdc++/acinclude.m4 (see
> GLIBCPP_ENABLE_THREADS). I think Carlo explained this part of it
> well. If you think <> should be used in place of "", then that is the
> correct place to make a change.
>
> During the discussion of libstdc++/3243 , someone (Carlo?) mentioned
> that it might be wise to convert the "" to <> but it wasn't done.
>
> I think a patch to libstdc++/acinclude.m4 for mainline would be
> accepted to fix this.
Here's a patch as proposed by you to implement this.
It has been bootstrapped on i686-linux-gnu and passed the testsuite
but I encountered lots of failures in the testsuite with "(test for
excess errors)" like:
FAIL: 17_intro/header_cassert.cc (test for excess errors)
Excess errors:
cc1plus: warning: changing search order for system directory "/opt/gcc-3.1-devel/i686-pc-linux-gnu/include"
cc1plus: warning: as it has already been specified as a system directory
The patch looks fine to me but I'm confused with those errors messages
that I didn't get without my patch. Is my autoconf/automake version
broken (autoconf 2.13, automake 1.4)?
Andreas
2001-07-11 Andreas Jaeger <aj@suse.de>
* acinclude.m4 (GLIBCPP_ENABLE_THREADS): Install gthr.h with
include <> instead of include "".
* aclocal.m4: Regenerate.
* configure: Likewise.
============================================================
Index: libstdc++-v3/acinclude.m4
--- libstdc++-v3/acinclude.m4 2001/07/10 12:55:05 1.165
+++ libstdc++-v3/acinclude.m4 2001/07/11 14:57:02
@@ -1162,7 +1162,8 @@ AC_DEFUN(GLIBCPP_ENABLE_THREADS, [
AC_OUTPUT_COMMANDS([d=include/bits; a='[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]'
rm -f $d/gthr.h $d/gthr-single.h $d/gthr-default.h
sed '/^#/s/\('"$a$a"'*\)/_GLIBCPP_\1/g' <$d/gthr.h-in \
- | sed 's,"gthr-,"bits/gthr-,' >$d/gthr.h
+ | sed 's,"gthr-,"bits/gthr-,' \
+ | sed 's/include "\(.*\)"/include <\1>/g' >$d/gthr.h
sed 's/\(UNUSED\)/_GLIBCPP_\1/g' <$d/gthr-single.h-in \
| sed 's/\(GCC'"$a"'*_H\)/_GLIBCPP_\1/g' >$d/gthr-single.h
sed 's/\(UNUSED\)/_GLIBCPP_\1/g' <$d/gthr-default.h-in \
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj