Re: Warning different width?
Re: Warning different width?
- Subject: Re: Warning different width?
- From: "Clark Cox" <email@hidden>
- Date: Mon, 24 Dec 2007 08:59:37 -0500
On Dec 24, 2007 6:19 AM, Hans van der Meer <email@hidden> wrote:
[snip]
> But then XCode gives me the following WARNING on the line with the
> return:
>
> warning: passing argument 1 of 'numberWithUnsignedShort:' with
> different width due to prototype
>
> In the documentation I read for NSNumber:
>
> Creates and returns an NSNumber object containing a given value,
> treating it as an unsigned short.
> + (NSNumber *)numberWithUnsignedShort:(unsigned short)value
>
> while in NSString.h (included through Foundation.h) the unichar is
> defined by:
>
> typedef unsigned short unichar;
>
> It escapes me what is wrong here. Do I miss something or is perhaps
> the compiler overcautious here?
You're using the "-Wconversion" flag. That warning flag doesn't do
what you think it does :)
For modern C code (i.e. code written after C was standardized in
1989), it is essentially useless.
--
Clark S. Cox III
email@hidden
_______________________________________________
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