• 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: Warning different width?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Warning different width? (From: Hans van der Meer <email@hidden>)

  • Prev by Date: Localization Issue
  • Next by Date: Do NSSearchFields really send an action up the responder chain when the user clicks the cancel button?
  • Previous by thread: Warning different width?
  • Next by thread: calayer mask property
  • Index(es):
    • Date
    • Thread