• 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 GCC Bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible GCC Bug?


  • Subject: Re: Possible GCC Bug?
  • From: Scott Thompson <email@hidden>
  • Date: Tue, 8 Apr 2008 12:07:39 -0500

I've been away from 'C' for over ten years, and just come back to port a legacy app to the MAC. The following code is misbehaving under the XCode 3.0 Debug configuration (GCC4). I'd appreciate any suggestions.
 
// int fred has value 13
DisposeWindow(WinData->window);    // Carbon call
// int fred now has value 27
 
This is burried in thousands of lines of code, and other calls to DisposeWindow(..) don't affect "fred" at all.
 
My nasty work-around for this is:
 
int Safefred = fred;
DisposeWindow(WinData->window);
fred = Safefred;
 
Thanks for any suggestions.
 
Greg

How is the window pointed to by WinData->window allocated?

Depending on the age of the legacy application, the window in question may not have been allocated properly for the Carbon environment.  Most importantly, WindowPtr's are no longer actual pointers, they are WindowRefs, an opaque data structure.  If this is very old code, it might be trying to hand-allocate the Window structure which is bound to cause problems.  If fred is allocated in close proximity to that window structure, he may be getting stomped on when the Window is improperly allocated and subsequently released.

Scott
 _______________________________________________
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

References: 
 >Possible GCC Bug? (From: "Greg Knight" <email@hidden>)
 >Re: Possible GCC Bug? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: app not starting from xcode
  • Next by Date: Target Info: Build: Why sometimes sections of GCC settings?
  • Previous by thread: Re: Possible GCC Bug?
  • Next by thread: Re: Possible GCC Bug?
  • Index(es):
    • Date
    • Thread