summaryrefslogtreecommitdiffstats
path: root/sys/sys/cdefs.h
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2017-01-27 04:52:27 +0000
committerpfg <pfg@FreeBSD.org>2017-01-27 04:52:27 +0000
commitddd621488fdc8820b38c0aef9b670a74e296b1e1 (patch)
treef2d0b35b1aa5cb0a7af37f3723093ae5e377d0f7 /sys/sys/cdefs.h
parent081e2411ea432b4a67ae61ec8f64a6b3ea4a52be (diff)
downloadFreeBSD-src-ddd621488fdc8820b38c0aef9b670a74e296b1e1.zip
FreeBSD-src-ddd621488fdc8820b38c0aef9b670a74e296b1e1.tar.gz
MFC r312538:
Addition of clang nullability qualifiers. For consistency with the qualifiers added in r310977, define a new qualifier _Null_unspecified which is also defined in clang 3.7+. Add two new macros: __NULLABILITY_PRAGMA_PUSH __NULLABILITY_PRAGMA_POP These are for use in headers when we want avoid noisy warnings if some pointers are left without nullability annotations. These are added with way ahead of their first use to teach the GCC ports headers of their existance before their first use.
Diffstat (limited to 'sys/sys/cdefs.h')
-rw-r--r--sys/sys/cdefs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 7db4f25..179a609 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -793,6 +793,13 @@
#if !(defined(__clang__) && __has_feature(nullability))
#define _Nonnull
#define _Nullable
+#define _Null_unspecified
+#define __NULLABILITY_PRAGMA_PUSH
+#define __NULLABILITY_PRAGMA_POP
+#else
+#define __NULLABILITY_PRAGMA_PUSH _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wnullability-completeness\"")
+#define __NULLABILITY_PRAGMA_POP _Pragma("clang diagnostic pop")
#endif
/*
OpenPOWER on IntegriCloud