Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jan 2017 16:16:31 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r311519 - stable/11/sys/sys
Message-ID:  <201701061616.v06GGVMZ066867@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701061616.v06GGVMZ066867>