• 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: Removing a compiler warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing a compiler warning


  • Subject: Re: Removing a compiler warning
  • From: "b.bum" <email@hidden>
  • Date: Sat, 31 Jan 2004 17:15:02 -0800

On Jan 31, 2004, at 4:03 PM, Greg Hulands wrote:
In an old project I have just started to bring up to date for panther I have a convention in the dealloc method to return [super dealloc]. This is in every class, so it is generating a lot of warnings. Is there a way to suppress this warning in GCC 3.3?

Attempting to return a value from a method that returns (void) really is an error. GCC3.3 is just more anal about reporting it than prior versions of the compiler, it seems.

While invoking [super dealloc] at the end of your dealloc method is definitely the correct convention, 'return [super dealloc];' is not. The warning should be treated as a bug in your code. There may be a flag to suppress such warnings, but doing so is only asking for trouble in that it is going to suppress the error in other potentially nasty situations.

Given that you likely used the exact same line of code everywhere, you should be able to easily do a global find-and-replace with Xcode. Just find 'return [super dealloc]' and replace with '[super dealloc]'.

If some hits come up in the find panel that you don't want to replace, keep in mind that you can select just the hits you want to replace. cmd-click to extend the selection in a non-contiguous fashion....

b.bum
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Removing a compiler warning
  • Next by Date: Re: Cocoa/Windows parallel dvlpmt
  • Previous by thread: Re: Removing a compiler warning
  • Next by thread: NOT related to Cocoa (Sorry)
  • Index(es):
    • Date
    • Thread