Skip to content

Commit

Permalink
[sanitizer_common] Move UNDEFINED attribute outside _MSC_VER guard
Browse files Browse the repository at this point in the history
The __has_attribute check is sufficient, and if clang-cl is used, the
attribute will be available as well.
  • Loading branch information
melver committed Jun 8, 2023
1 parent 123f807 commit 9065357
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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;
Expand Down

0 comments on commit 9065357

Please sign in to comment.