Module Name: src
Committed By: kamil
Date: Wed Sep 18 15:06:03 UTC 2019
Modified Files:
src/sys/sys: cdefs.h
Log Message:
Define __noubsan in sys/cdefs.h for KERNEL sanitization
To generate a diff of this commit:
cvs rdiff -u -r1.143 -r1.144 src/sys/sys/cdefs.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.143 src/sys/sys/cdefs.h:1.144
--- src/sys/sys/cdefs.h:1.143 Sun Sep 15 15:18:45 2019
+++ src/sys/sys/cdefs.h Wed Sep 18 15:06:03 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.143 2019/09/15 15:18:45 kamil Exp $ */
+/* $NetBSD: cdefs.h,v 1.144 2019/09/18 15:06:03 kamil Exp $ */
/* * Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
@@ -331,6 +331,14 @@
#else
#define __noasan /* nothing */
#endif
+
+#if defined(__clang__)
+#define __noubsan __attribute__((no_sanitize("undefined")))
+#elif __GNUC_PREREQ__(4, 9)
+#define __noubsan __attribute__((no_sanitize_undefined))
+#else
+#define __noubsan /* nothing */
+#endif
#endif
#if defined(__COVERITY__) || \