• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
C++: std::ostringstream default ctor problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: C++: std::ostringstream default ctor problems
      • From: Howard Hinnant <email@hidden>
    • Re: C++: std::ostringstream default ctor problems
      • From: Rush Manbert <email@hidden>
  • Prev by Date: Re: Getting system bundle icon on custom plugin type?
  • Next by Date: Re: warning at nslog
  • Previous by thread: Re: warning at nslog
  • Next by thread: Re: C++: std::ostringstream default ctor problems
  • Index(es):
    • Date
    • Thread