This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: system.h vs. C++ STL headers again
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Bernd Schmidt <bernds at codesourcery dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Nov 2014 12:13:14 +0100
- Subject: Re: system.h vs. C++ STL headers again
- Authentication-results: sourceware.org; auth=none
- References: <CAFULd4Z1gspEpeVbAsbR6K1NaR+Bg9VfLpAA8png+=xyLoCOqw at mail dot gmail dot com> <4E8B61D5-FBFE-4BC8-A252-9B1580E1E8DE at gmail dot com> <alpine dot DEB dot 2 dot 11 dot 1411102250210 dot 8347 at laptop-mg dot saclay dot inria dot fr> <CAFULd4YMgeks5+PtpOkuacvMUftk-WvWyPD0L5-R=+g4ZtHYJw at mail dot gmail dot com> <CAFULd4baLHKGQ2KKmt7uA8zAdqN4gWV-GHbh_-Quj3kp__v6NA at mail dot gmail dot com> <CAFiYyc3Jd8_arWsFaTRA2j-NKtDx4hP0rE0n7rz6+RmpoSVvPg at mail dot gmail dot com> <20141114071816 dot GF5026 at tucnak dot redhat dot com> <CAFiYyc1UngHAApKtsRR52fg9EEE3C34RB5te+T0hVLS=pKvbdw at mail dot gmail dot com> <20141114110337 dot GL5026 at tucnak dot redhat dot com>
On Fri, Nov 14, 2014 at 12:03 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Nov 14, 2014 at 11:57:57AM +0100, Richard Biener wrote:
>> > ? There are also some comments about stdarg.h and stdio.h ordering,
>> > dunno what it comes from and if it is still relevant when we require
>> > C++ compiler.
>>
>> I think we should simply discourage people from using sstream for
>> example.
>
> That would be my preference too of course, unfortunately Bernd chose to use
> it everywhere (grep '<<' nvptx.c').
>
>> But I don't see how we can live without system.h with all the weird
>> host systems still around - thus your solution above will very likely
>> not work.
>
> Well, I wasn't suggesting without system.h, I was suggesting to include
> config.h first (that is required anyway), then C++ STL headers, then
> system.h and then other GCC headers.
I'm quite sure that we'll find a system where that won't work? But
sure - maybe it's worth a try...
Richard.
>> Eventually we can split system.h into a c-system.h and cxx-system.h
>> so we can distinguish between uses in files compiled with a C and
>> a C++ compiler?
>
> That wouldn't help here.
>
> Jakub