This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++ [io]fstream cannot open file in binary mode (g++ and egcs)
- To: per at bothner dot com
- Subject: Re: libstdc++ [io]fstream cannot open file in binary mode (g++ and egcs)
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 26 Jan 2000 20:19:50 +0100
- CC: uue at pauzner2 dot dnttm dot rssi dot ru, gcc-bugs at gcc dot gnu dot org
- References: <200001260857.JAA03506@loewis.home.cs.tu-berlin.de> <m2ya9cn0k2.fsf@magnus.bothner.com>
> I have a feeling may not be correct. I remember receiving similar
> bug reports and suggestions. It seemed like an obvious fix - but
> but doing so violated the C++ Standard. Things may be different
> in this case, but you should make sure.
I checked before I submitted the patch. 27.8.1.9,
[lib.ofstream.cons]/2 says (about the ofstream ctor)
# Effects: Constructs an object of class basic_ofstream<charT,traits>,
# initializing the base class with basic_ostream(& sb) and
# initializing sb with basic_filebuf<charT,traits>()) (27.6.2.2,
# 27.8.1.2), then calls rdbuf()>open( s, mode|out).311) If that
# function returns a null pointer, calls setstate(failbit), (which may
# throw ios_base::failure).
A similar statement is there for the open method, so I think this
patch is conforming. Please note that a similar change was introduced
to libstdc++ v3 not long ago.
Regards,
Martin