From: Marco Elver Date: Wed, 7 Jun 2023 20:44:49 +0000 (+0200) Subject: [sanitizer_common] Move UNDEFINED attribute outside _MSC_VER guard X-Git-Tag: upstream/17.0.6~5753 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90653579c01700b7ba33ba29a02975ce6ef4881e;p=platform%2Fupstream%2Fllvm.git [sanitizer_common] Move UNDEFINED attribute outside _MSC_VER guard The __has_attribute check is sufficient, and if clang-cl is used, the attribute will be available as well. --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h index e5dd65a..8d414b8 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h @@ -236,11 +236,6 @@ typedef u64 tid_t; # define PREFETCH(x) __builtin_prefetch(x) # endif # define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -# if __has_attribute(uninitialized) -# define UNINITIALIZED __attribute__((uninitialized)) -# else // __has_attribute(uninitialized) -# define UNINITIALIZED -# endif // __has_attribute(uninitialized) #endif // _MSC_VER #if !defined(_MSC_VER) || defined(__clang__) @@ -265,6 +260,12 @@ typedef u64 tid_t; # define FALLTHROUGH #endif +#if __has_attribute(uninitialized) +# define UNINITIALIZED __attribute__((uninitialized)) +#else +# define UNINITIALIZED +#endif + // Unaligned versions of basic types. typedef ALIGNED(1) u16 uu16; typedef ALIGNED(1) u32 uu32;