[cfe-dev] RFC: Nullability qualifiers

Jonathan Schleifer js at webkeks.org
Sun Jun 14 08:31:41 PDT 2015


> Nullability Qualifiers
> We propose the addition of a new set of type qualifiers,  spelled __nullable, __nonnull, and __null_unspecified, to Clang. These are collectively known as nullability qualifiers and may be written anywhere any other type qualifier may be written (such as const) on any type subject to the following restrictions:

__nonnull is already used by glibc headers. Can you please use a different name so that we don't have the __block situation all over again? And, hopefully, do that before everybody using the beta has already changed their code to use __nonnull and thus making it too late to change it?

As this seems to be a general problem (Apple introducing language extensions that work fine on OS X/iOS but breaking glibc), maybe it would make sense to not enable any language extensions when Clang can detect it's a (g)libc header? Or would it maybe be possible that you use _Foo instead __foo for your language extensions? The C standard reserves both for the compiler and libc, however, glibc only seems to use __foo. So, maybe change this to _Nonnull and _Nullable?

Thanks.

PS: Please CC me as I'm not on the list!

--
Jonathan





More information about the cfe-dev mailing list