Re: Why does NSArray count return NSUInteger?
Re: Why does NSArray count return NSUInteger?
- Subject: Re: Why does NSArray count return NSUInteger?
- From: Sean McBride <email@hidden>
- Date: Mon, 30 May 2011 17:06:49 -0400
- Organization: Rogue Research Inc.
On Mon, 30 May 2011 13:56:38 -0700, Dave Zarzycki said:
>As others have pointed out, this has nothing to do with Objective-C or
>Cocoa. This behavior is true of any C derived language or library. If
>this aspect of C bothers you, then please consider adding -Wconversion
>to your project's build settings (CFLAGS):
>
>$ clang -Wall -Wextra -Wconversion -Os -c test.c
>test.c:2:18: warning: implicit conversion turns literal floating-point
>number into integer: 'double' to 'unsigned int'
> [-Wliteral-conversion]
>void g(void) { f(3.1); f(-1); }
> ~ ^~~
>test.c:2:26: warning: implicit conversion changes signedness: 'int' to
>'unsigned int' [-Wsign-conversion]
>void g(void) { f(3.1); f(-1); }
> ~ ^~
Though one should only use -Wconversion with clang, and not the Apple-
provided gcc 4.2, where it has a different meaning and is largely
useless (fixed in newer gcc).
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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