C++: std::ostringstream default ctor problems
C++: std::ostringstream default ctor problems
- Subject: C++: std::ostringstream default ctor problems
- From: Dan Caugherty <email@hidden>
- Date: Sun, 27 Sep 2009 21:12:37 -0400
Hey all --
This may or may not be a relevant topic for this group, so please
gently point me to the right place if not. If so, then please read on.
I have the following snippet of code compiling successfully on Xcode
3.2 and GCC 4.2:
const std::string
foobar::to_string() const
{
std::ostringstream oss;
oss << *this; // gdb says odd things happen right here
return oss.str();
}
Under GCC 4.2, I see the following error:
malloc: *** error for object 0xa0451db0: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
..and sure enough, the ostringstream instance is trying to free a
buffer that it never allocated. Naughty naughty.
Is this a known issue with GCC 4.2, or am I just doing something wrong?
Thanks,
-- Dan Caugherty
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden