[sanitizer_common] Move UNDEFINED attribute outside _MSC_VER guard
authorMarco Elver <elver@google.com>
Wed, 7 Jun 2023 20:44:49 +0000 (22:44 +0200)
committerMarco Elver <elver@google.com>
Thu, 8 Jun 2023 11:03:08 +0000 (13:03 +0200)
The __has_attribute check is sufficient, and if clang-cl is used, the
attribute will be available as well.

compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h

index e5dd65a..8d414b8 100644 (file)
@@ -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;