svn commit: r311519 - stable/11/sys/sys

Pedro F. Giffuni pfg at FreeBSD.org
Fri Jan 6 16:16:32 UTC 2017


Author: pfg
Date: Fri Jan  6 16:16:30 2017
New Revision: 311519
URL: https://svnweb.freebsd.org/changeset/base/311519

Log:
  MFC	r310977:
  Addition of clang nullability qualifiers.
  
  Add two new qualifiers for use by the static checkers:
  
  _Nonnull
  The _Nonnull nullability qualifier indicates that null is not a meaningful
  value for a value of the _Nonnull pointer type.
  
  _Nullable
  The _Nullable nullability qualifier indicates that a value of the
  _Nullable pointer type can be null.
  
  These were introduced in Clang 3.7. For more information, see:
  http://clang.llvm.org/docs/AttributeReference.html#nonnull
  
  We add these now without using them so that the GCC ports have time to
  pick up the header change.
  
  Hinted by:	Android Bionic libc
  Also seen in:	Apple's Libc-1158.20.4

Modified:
  stable/11/sys/sys/cdefs.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/sys/cdefs.h
==============================================================================
--- stable/11/sys/sys/cdefs.h	Fri Jan  6 14:05:31 2017	(r311518)
+++ stable/11/sys/sys/cdefs.h	Fri Jan  6 16:16:30 2017	(r311519)
@@ -804,6 +804,14 @@
 #endif
 
 /*
+ * Nullability qualifiers: currently only supported by Clang.
+ */
+#if !(defined(__clang__) && __has_feature(nullability))
+#define	_Nonnull
+#define	_Nullable
+#endif
+
+/*
  * Type Safety Checking
  *
  * Clang provides additional attributes to enable checking type safety


More information about the svn-src-stable mailing list