[cfe-dev] RFC: Nullability qualifiers

Jonathan Schleifer js at webkeks.org
Mon Jun 15 15:21:09 PDT 2015

Am 15.06.2015 um 23:01 schrieb Richard Smith <richard at metafoo.co.uk>:

> Well, 'restrict' was not a reserved identifier in C89. __nonnull is a reserved identifier in all C-family languages. But you're right, some people might be #defining __nonnull themselves, and if they do, their code will be non-portable.

Well yes, that's true…

> I don't think that using two separate reserved identifiers for this keyword is really much nicer than using one. If we could use a 'prettier' keyword for this, like "nonnull", that might be nicer, but we really don't want Clang to introduce its own non-conforming language mode like that. But you can create this state of affairs yourself with a #define.

That's why I said only for OS X / iOS.

#define nonnull __nonnull will not work, as this *also* introduces nonnull for use within ObjC method declarations and as a property attribute.


More information about the cfe-dev mailing list