The first version of the test with the required changes to 21.string.* and rw_streambuf.h is here: http://people.apache.org/~antonp/stdcxx06232006/ 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 __rw::__rw_synchronized::_C_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): http://people.apache.org/~antonp/stdcxx06232006/lib/ What do you think about this? Thanks, Anton Pevtsov -----Original Message----- From: Martin Sebor [mailto:[EMAIL PROTECTED] Sent: Thursday, June 22, 2006 06:00 To: [email protected] Subject: Re: test for lib.string.io Anton Pevtsov wrote: [...] > Here is another one possible issue: > > As I understand 21.3.7.9, 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 http://people.apache.org/~sebor/width_test.cpp > > incubator\stdcxx\trunk\include\ostream > > // 21.3.7.9, 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.data (), __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 :) Thanks Martin
