This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC Fix for 9964.cc and 9507.cc on ia64-hpux
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Pétur Runólfsson <peturr02 at ru dot is>
- Cc: <gcc-patches at gcc dot gnu dot org>, <libstdc++ at gcc dot gnu dot org>, "Phil Edwards" <phil at codesourcery dot com>, "Benjamin Kosnik" <bkoz at constant dot com>, "Gabriel Dos Reis" <gdr at integrable-solutions dot net>
- Date: Tue, 03 Feb 2004 10:00:22 -0800
- Subject: Re: RFC Fix for 9964.cc and 9507.cc on ia64-hpux
- References: <07D05A69A3D0C14FAEA60C3ACE8E5564028F5618@mail.ru.is>
Pétur Runólfsson <peturr02@ru.is> writes:
> Zack Weinberg wrote:
>> The majority of the problem is bad test case code.
>
> It's pretty hard to write tests that fail portably (both of these test
> how basic_filebuf handles low-level errors).
True.
>> I've also added calls to alarm()
>> and wait() to ensure that the tests never run for more than ten
>> seconds nor do they leave child processes hanging around.
>
> This seems like a good idea for any test case that uses mkfifo.
Agreed.
>> Unfortunately, this
>> constitutes an ABI change since _M_open_mode was exported.
>
> There are lots of ABI changes between 3.3 and 3.4, including changes
> to __basic_file.
So in 3.4 I can just make _M_open_mode completely go away? Cool.
How about 3.3?
>> +static const char *fopen_mode(std::ios_base::openmode mode)
>
> This should probably be uglified and formatted as:
> static const char*
> __fopen_mode(std::ios_base::openmode __mode)
Why? It's static and it's not in any kind of header file.
>> +#ifdef _GLIBCXX_DEPRECATED
>
> This shouldn't be needed for anything in the implementor namespace.
Ok.
>> - std::filebuf* r = fbuf.open(name, std::ios_base::out | std::ios_base::ate);
>> + std::filebuf* r = fbuf.open(name, std::ios_base::in | std::ios_base::out | std::ios_base::ate);
>
> Note that the combination (std::ios_base::out | std::ios_base::ate)
> doesn't really make sense: out (without in) implies trunc, so out will
> always open at the end of the file (which is the same as the beginning)
> which means that the ate is redundant unless in is used.
Yes, indeed.
zw