• 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: NSUInteger in for-loop?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUInteger in for-loop?


  • Subject: Re: NSUInteger in for-loop?
  • From: "Michael Ash" <email@hidden>
  • Date: Mon, 15 Sep 2008 13:57:34 -0400

On Mon, Sep 15, 2008 at 1:48 PM, Charles Srstka
<email@hidden> wrote:
> On Sep 15, 2008, at 11:34 AM, Sean McBride wrote:
>
>> And gcc can catch these kinds of things!
>>
>> $ gcc-4.2 -framework Cocoa -std=c99 -Wall -Wextra ~/Desktop/test.m
>>
>> /Users/sean/Desktop/test.m: In function 'main':
>> /Users/sean/Desktop/test.m:7: warning: comparison of unsigned expression
>>>
>>> = 0 is always true
>>
>> Turn on those compiler warnings! :)
>
> -Wall yes, but -Wextra can get pretty obnoxious. In my experience, that one
> tends to flood you with "unused parameter" warnings every time you have an
> IBAction that doesn't use the "sender" parameter, or you have a notification
> handler that doesn't use the notification object, or you implement some API
> that requires you to implement certain functions or methods that contain
> parameters you don't need, etc.

gcc allows you to disable individual warnings. So using "-Wall -Wextra
-Wno-unused-parameter" will give you all of the good warnings with
none of the annoying unused parameter ones. In practice, this single
warning is the only one I've found in the entire set of -Wall -Wextra
to do more harm than good. Every other warning they have has, in my
experience, been completely legitimate. And -Wextra adds so many more
useful warnings that I'd never consider leaving it out.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSUInteger in for-loop?
      • From: Charles Srstka <email@hidden>
References: 
 >NSUInteger in for-loop? (From: Alex Reynolds <email@hidden>)
 >Re: NSUInteger in for-loop? (From: Brett Powley <email@hidden>)
 >Re: NSUInteger in for-loop? (From: "Sean McBride" <email@hidden>)
 >Re: NSUInteger in for-loop? (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: NSUInteger in for-loop?
  • Next by Date: Re: async NSOperation and NSOperationQueue
  • Previous by thread: Re: NSUInteger in for-loop?
  • Next by thread: Re: NSUInteger in for-loop?
  • Index(es):
    • Date
    • Thread