• 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
Re: Possible C++ optimizer problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible C++ optimizer problem


  • Subject: Re: Possible C++ optimizer problem
  • From: Steve Checkoway <email@hidden>
  • Date: Wed, 19 Jul 2006 17:10:33 -0700


On Jul 19, 2006, at 4:41 PM, David Dunham wrote:


That would normally be my guess. But I changed this line

	return Rack(*this).unload(used);

to this

	string	dummyTiles(m_tiles);
	dummyTiles += "";
	Rack			dummyRack(dummyTiles);
	return dummyRack.unload(used);

Without knowing what Rack, m_tiles, nor this are, it'd be hard to say anything. Unless I'm mistaken, it looks like Rack's ctor takes a string, string&, or const string& argument. Assuming that's the only ctor with one argument, that would make this an instance of a subclass of string. (I believe that subclassing the std classes is not allowed. Certainly you cannot add new data members since they might not be destroyed because string doesn't have a virtual dtor.)


If you compile with -Wall, do you get any warnings?


in order to delay the crash. So far as I could tell, all of that was necessary -- I needed to use an explicit constructor rather than the compiler-written copy-constructor, and I need to make sure that the constructor's string arg wasn't the same. Otherwise, the instance variable m_tiles was getting changed (the unload method does alter m_tiles, though it doesn't trash it the way I was seeing).

How exactly was it being trashed?


-- Steve Checkoway



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Re: Possible C++ optimizer problem
      • From: "Clark Cox" <email@hidden>
References: 
 >Possible C++ optimizer problem (From: David Dunham <email@hidden>)
 >Re: Possible C++ optimizer problem (From: Steve Checkoway <email@hidden>)
 >Re: Possible C++ optimizer problem (From: David Dunham <email@hidden>)

  • Prev by Date: Version Inquiry...
  • Next by Date: Re: Version Inquiry...
  • Previous by thread: Re: Possible C++ optimizer problem
  • Next by thread: Re: Re: Possible C++ optimizer problem
  • Index(es):
    • Date
    • Thread