incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anton Pevtsov" <Ant...@moscow.vdiweb.com>
Subject RE: %{#*S} inserts NULs
Date Thu, 09 Mar 2006 16:07:11 GMT
Martin, the latest changes that you made fix the problem.

Thanks,
Anton Pevtsov


-----Original Message-----
From: Martin Sebor [mailto:sebor@roguewave.com] 
Sent: Tuesday, March 07, 2006 23:53
To: stdcxx-dev@incubator.apache.org
Subject: Re: %{#*S} inserts NULs


I still can't reproduce the behavior. I tried both x86 (gcc 3.2.3) and
x86_64 (gcc 3.4.4) but the test case behaves as expected. What I said I
saw below must have been some kind of a fluke...

What exactly is your architecture/OS/compiler/build type?

Martin

Martin Sebor wrote:
> Anton Pevtsov wrote:
> 
>> Yes, here it is:
>>
>> #include <string>
>> #include <rw_printf.h>
>>
>> int main (int argc, char** argv)
>> {
>>     wchar_t* tmp = L"abc";
>>     std::basic_string<wchar_t, std::char_traits<wchar_t>, 
>> std::allocator<wchar_t> > s (tmp, 3);
>>     rw_printf ("%{#*S}\n", sizeof (wchar_t), &s);
>>
>>     return 0;
>> }
>>
>> I got "a\0b". Maybe, I use the %{#*S} in wrong way?
> 
> 
> No (except for passing size_t instead of int to it), but I still can't

> reproduce the behavior you describe. I get L"abc" just as you expect.
> 
> Hang on a second, though. I'm testing this on Solaris/SPARC. On 
> Linux/x86_64 I get L"a\0\0" so there clearly is a problem with the 
> directive. Let me look into it.
> 
> Martin


Mime
View raw message