RE: Getting incorrect behavior on strstream

2007-06-25 Thread Jeremy Dean
e. Jeremy -Original Message- From: Martin Sebor [mailto:[EMAIL PROTECTED] Sent: Monday, June 25, 2007 11:36 AM To: stdcxx-dev@incubator.apache.org Subject: Re: Getting incorrect behavior on strstream Farid Zaripov wrote: >> -Original Message- >> From: Jeremy Dean [

Re: Getting incorrect behavior on strstream

2007-06-25 Thread Martin Sebor
I agree with Farid that test2() and test3() exhibit undefined behavior because they both fail to append the required NUL to the string before formatting it via the "%s" printf directive. But the test program does demonstrate a real problem, and that is the formatting of infinity when the stream p

Re: Getting incorrect behavior on strstream

2007-06-25 Thread Martin Sebor
Farid Zaripov wrote: -Original Message- From: Jeremy Dean [mailto:[EMAIL PROTECTED] Sent: Friday, June 22, 2007 11:45 PM To: stdcxx-dev@incubator.apache.org Subject: Getting incorrect behavior on strstream I have a testcase that is showing incorrect behavior ostrstream or

RE: Getting incorrect behavior on strstream

2007-06-25 Thread Farid Zaripov
> -Original Message- > From: Jeremy Dean [mailto:[EMAIL PROTECTED] > Sent: Friday, June 22, 2007 11:45 PM > To: stdcxx-dev@incubator.apache.org > Subject: Getting incorrect behavior on strstream > > I have a testcase that is showing incorrect behavior ostrstre

Getting incorrect behavior on strstream

2007-06-22 Thread Jeremy Dean
I have a testcase that is showing incorrect behavior ostrstream or ostringstream: #include #include #include #include #include #include void test1() { std::ostringstream S; long double x = std::pow(1e300,2); S << "Something " << std::setprecision(8) << x; S << " else";