stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <>
Subject RE: test for
Date Fri, 23 Jun 2006 15:29:37 GMT
The first version of the test with the required changes to 21.string.*
and rw_streambuf.h is here:
Also there is a small change to char.cpp to allowing the strings ending
with '\0' expanding.

The test generates asserts due to STDCXX-206 and problem with
ios_base::badbit / failbit.
Also there is a question about exception safety:

If exceptions mask == ios_base::goodbit then operator>>, operator << and
getline hides all exceptions thrown inside function.
The Dinkumware does the same, but STLPort doesn't.
Is this correct?

During the test implementation I found that there is a problem with test
linking on Windows, 11d and 15d configurations:
"unresolved external symbol "public: static struct __rw::__rw_mutex
I investigate the problem and found that this member of
__rw_synchronized structure is not marked as _RWSTD_EXPORT.
The possible fix to this issue is here (differeces to files
include/rw/_mutex.h and src/exception.cpp):
What do you think about this?

Anton Pevtsov

-----Original Message-----
From: Martin Sebor [] 
Sent: Thursday, June 22, 2006 06:00
Subject: Re: test for

Anton Pevtsov wrote:
> Here is another one possible issue:
> As I understand, paragraph 4 the os.setstate() should be 
> called after os.width(0). In stdcxx width(0) is called after the 
> setstate() and if the exceptions mask is not ios_base::goodbit then 
> width(0) will not called. The Dinkumware STL and STLPort calls width 
> (0) before setstate().

I agree, although I note that GNU libstdc++ behaves the same as stdcxx.
I believe both implementations are incorrect.

FWIW, the standard is slightly inconsistent when it comes to these
things. I've sent an email to the committee's reflector proposing to
clean them up (see the attachment). I also put together a test program
exercising all formatted output functions (including the string overload
which isn't listed as one but should be) according to the current
requirements as well as according to the requirements I propose. See

> incubator\stdcxx\trunk\include\ostream
> //, p3 - defined here, declared inline in <string> 
> template<class _CharT, class _Traits, class _Allocator> inline 
> basic_ostream<_CharT, _Traits>&
> operator<< (basic_ostream<_CharT, _Traits>                  & __strm,
>            const basic_string<_CharT, _Traits, _Allocator> &__str) {
>    _RW::__rw_insert (__strm, (), __str.length (),
>                      __strm.width ()).width (0);
>    return __strm;
> }
> See the attached test, please.
> What do you think about this?

Let's create an issue and fix it. The change shouldn't be too difficult.
I'll leave it up to you to propose a patch :)


View raw message