diff options
author | Ryan Libby <rlibby@FreeBSD.org> | 2019-12-21 02:43:20 +0000 |
---|---|---|
committer | Ryan Libby <rlibby@FreeBSD.org> | 2019-12-21 02:43:20 +0000 |
commit | 4c235c008383701d66b8e15878a08c7bccf3664f (patch) | |
tree | fef72475e547bd94e4119452fe64886eaf8f0957 /sys/sys/cdefs.h | |
parent | 0e47020f7f20c9ecf5d796497064f1ff124fbfa6 (diff) | |
download | src-4c235c008383701d66b8e15878a08c7bccf3664f.tar.gz src-4c235c008383701d66b8e15878a08c7bccf3664f.zip |
Notes
Diffstat (limited to 'sys/sys/cdefs.h')
-rw-r--r-- | sys/sys/cdefs.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index 42734b788b30..1eef6b78aba6 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -873,8 +873,12 @@ /* Function should not be analyzed. */ #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) -/* Function or variable should not be sanitized, ie. by AddressSanitizer */ -#if __has_attribute(no_sanitize) +/* + * Function or variable should not be sanitized, i.e. by AddressSanitizer. + * GCC has the nosanitize attribute, but as a function attribute only, and + * warns on use as a variable attribute. + */ +#if __has_attribute(no_sanitize) && defined(__clang__) #define __nosanitizeaddress __attribute__((no_sanitize("address"))) #else #define __nosanitizeaddress |