On Sep 15, 2008, at 11:24, Sean McBride wrote:
'#pragma unused' will cause some compilers to warn "unknown pragma".
Though, since this is the Cocoa list, and Cocoa is not really
portable,
I guess it doesn't matter.
There's also the convenient macro "__unused", which seems to work fine
for
On 9/15/08 12:17 PM, Nathan Kinsinger said:
>> Well, to each his own. I find it is a worthwhile tradeoff. For
>> action
>> methods, just do:
>>
>> - (IBAction)handleButton:(id)sender
>> {
>>(void)sender;
>>
>>...
>> }
>
>There is also "#pragma unused", it's kind of ugly but is specific
>
On Sep 15, 2008, at 12:57 PM, Michael Ash wrote:
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 th
On Sep 15, 2008, at 11:54 AM, Sean McBride wrote:
On 9/15/08 12:48 PM, Charles Srstka said:
-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, o
On Mon, Sep 15, 2008 at 1:48 PM, Charles Srstka
<[EMAIL PROTECTED]> 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':
On 9/15/08 12:48 PM, Charles Srstka said:
>-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
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 alway
On 9/15/08 2:45 PM, Brett Powley said:
>Second problem (which you'll see if you change the NSLog): counter is
>unsigned, so it *never* "turns negative".
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 fu
Thanks all for your quick insight!
-Alex
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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
On Sep 14, 2008, at 9:15 PM, Alex Reynolds <[EMAIL PROTECTED]>
wrote:
I'm wondering if I'm using unsigned integers (specifically NSUInteger)
properly or not.
I was under the impression that unsigned integers run from 0 to
MAX_INT, but when I use them in a "for" loop within these bounds, the
l
On Sep 15, 2008, at 00:45 , Brett Powley wrote:
On 15/09/2008, at 2:15 PM, Alex Reynolds wrote:
I'm wondering if I'm using unsigned integers (specifically
NSUInteger) properly or not.
I was under the impression that unsigned integers run from 0 to
MAX_INT, but when I use them in a "for"
On Sep 15, 2008, at 00:44 , Alex Reynolds wrote:
The %lu with casting seems to run into the same issue as %u:
...
2008-09-14 21:43:07.241 NSUIntTest[19779:10b] NSUInteger: 2
2008-09-14 21:43:07.259 NSUIntTest[19779:10b] NSUInteger: 1
2008-09-14 21:43:07.260 NSUIntTest[19779:10b] NSUInteger: 0
On Sun, Sep 14, 2008 at 9:44 PM, Alex Reynolds <[EMAIL PROTECTED]> wrote:
> The %lu with casting seems to run into the same issue as %u:
>
> ...
> 2008-09-14 21:43:07.241 NSUIntTest[19779:10b] NSUInteger: 2
> 2008-09-14 21:43:07.259 NSUIntTest[19779:10b] NSUInteger: 1
> 2008-09-14 21:43:07.260 NSUI
On Sep 15, 2008, at 00:42 , Alex Reynolds wrote:
Interesting:
...
2008-09-14 21:38:56.311 NSUIntTest[19750:10b] NSUInteger: 2
2008-09-14 21:38:56.329 NSUIntTest[19750:10b] NSUInteger: 1
2008-09-14 21:38:56.341 NSUIntTest[19750:10b] NSUInteger: 0
2008-09-14 21:38:56.344 NSUIntTest[19750:10b] NS
On 15/09/2008, at 2:15 PM, Alex Reynolds wrote:
I'm wondering if I'm using unsigned integers (specifically
NSUInteger) properly or not.
I was under the impression that unsigned integers run from 0 to
MAX_INT, but when I use them in a "for" loop within these bounds,
the loop does not seem
The %lu with casting seems to run into the same issue as %u:
...
2008-09-14 21:43:07.241 NSUIntTest[19779:10b] NSUInteger: 2
2008-09-14 21:43:07.259 NSUIntTest[19779:10b] NSUInteger: 1
2008-09-14 21:43:07.260 NSUIntTest[19779:10b] NSUInteger: 0
2008-09-14 21:43:07.261 NSUIntTest[19779:10b] NSUInt
Interesting:
...
2008-09-14 21:38:56.311 NSUIntTest[19750:10b] NSUInteger: 2
2008-09-14 21:38:56.329 NSUIntTest[19750:10b] NSUInteger: 1
2008-09-14 21:38:56.341 NSUIntTest[19750:10b] NSUInteger: 0
2008-09-14 21:38:56.344 NSUIntTest[19750:10b] NSUInteger: 4294967295
2008-09-14 21:38:56.344 NSUIntT
On Sep 14, 2008, at 9:15 PM, Alex Reynolds wrote:
I'm wondering if I'm using unsigned integers (specifically
NSUInteger) properly or not.
I was under the impression that unsigned integers run from 0 to
MAX_INT, but when I use them in a "for" loop within these bounds,
the loop does not se
On 2008 Sep, 14, at 21:31, Nathan Kinsinger wrote:
On Sep 14, 2008, at 10:15 PM, Alex Reynolds wrote:
NSLog(@"NSUInteger: %d", counter);
The correct type modifier for unsigned integers is %u not %d. Switch
it and try again to see what's really happening.
Ah, I believe he'll pro
On Sep 14, 2008, at 10:15 PM, Alex Reynolds wrote:
NSLog(@"NSUInteger: %d", counter);
The correct type modifier for unsigned integers is %u not %d. Switch
it and try again to see what's really happening.
--Nathan
___
Cocoa-dev mailing l
I'm wondering if I'm using unsigned integers (specifically NSUInteger)
properly or not.
I was under the impression that unsigned integers run from 0 to
MAX_INT, but when I use them in a "for" loop within these bounds, the
loop does not seem to always obey these constraints.
For example:
21 matches
Mail list logo