There was an error while loading. Please reload this page.
2 parents da71a3b + e197225 commit 2beabfaCopy full SHA for 2beabfa
1 file changed
include/rbs/defines.h
@@ -87,8 +87,13 @@
87
* Nullability annotations for pointer types.
88
* Clang supports _Nullable and _Nonnull to indicate whether a pointer may be NULL.
89
* On other compilers, these expand to nothing.
90
+ *
91
+ * They are Clang extensions, so a strict ISO C compilation rejects them with
92
+ * `-Wnullability-extension`, which is an error under `-pedantic-errors`. Expand
93
+ * them to nothing in that case, so that embedders compiling these headers with a
94
+ * conforming dialect (`-std=c99` and friends define `__STRICT_ANSI__`) still build.
95
*/
-#ifdef __clang__
96
+#if defined(__clang__) && !defined(__STRICT_ANSI__)
97
#define RBS_NULLABLE _Nullable
98
#define RBS_NONNULL _Nonnull
99
#else
0 commit comments