• 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: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3?


  • Subject: Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3?
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 25 Feb 2016 15:38:40 -0800


On Feb 25, 2016, at 3:31 PM, Quincey Morris <email@hidden> wrote:

It’s another example of the “any cast is a bug waiting to happen” problem that’s inherent in C-like languages.

To be fair, C++ does have const_cast, which only casts away ‘const’.

For this situation it would be nice if there was a cast like this:
[hostArray addObject: (_Nonnull) url.host];

That’s exactly what the NOTNULL macro in my first message does. Its value has the same type as its argument, just with _Nonnull:
#define NOTNULL(X) ((__typeof(X) _Nonnull)(X))

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3?
      • From: email@hidden
References: 
 >How to fix "misuse of 'nonnull'" warnings in Xcode 7.3? (From: Jens Alfke <email@hidden>)
 >Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3? (From: Quincey Morris <email@hidden>)
 >Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3? (From: Jens Alfke <email@hidden>)
 >Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Swift binding of NSEnumerator subclasses
  • Next by Date: Re: Swift binding of NSEnumerator subclasses
  • Previous by thread: Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3?
  • Next by thread: Re: How to fix "misuse of 'nonnull'" warnings in Xcode 7.3?
  • Index(es):
    • Date
    • Thread