aboutsummaryrefslogtreecommitdiffstats
path: root/src/warnings.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/warnings.h')
-rw-r--r--src/warnings.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/warnings.h b/src/warnings.h
new file mode 100644
index 00000000..4fdec095
--- /dev/null
+++ b/src/warnings.h
@@ -0,0 +1,23 @@
+// Copyright 2019-2024 David Robillard <d@drobilla.net>
+// SPDX-License-Identifier: ISC
+
+#ifndef SERD_SRC_WARNINGS_H
+#define SERD_SRC_WARNINGS_H
+
+#if defined(__clang__)
+
+/// Clang 15 null checking regressed, so we need to suppress it sometimes
+# define SERD_DISABLE_NULL_WARNINGS \
+ _Pragma("clang diagnostic push") \
+ _Pragma("clang diagnostic ignored \"-Wnullable-to-nonnull-conversion\"")
+
+# define SERD_RESTORE_WARNINGS _Pragma("clang diagnostic pop")
+
+#else
+
+# define SERD_DISABLE_NULL_WARNINGS
+# define SERD_RESTORE_WARNINGS
+
+#endif
+
+#endif // SERD_SRC_WARNINGS_H