Skip to content

Commit 8ed101f

Browse files
[compiler-rt] Work around a warning from -Wgnu-anonymous-struct
This patch works around: compiler-rt/lib/tysan/../sanitizer_common/sanitizer_platform_limits_posix.h:604:3: error: anonymous structs are a GNU extension [-Werror,-Wgnu-anonymous-struct]
1 parent 9f231a8 commit 8ed101f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,10 @@ struct __sanitizer_siginfo_pad {
601601
#if SANITIZER_LINUX
602602
# define SANITIZER_HAS_SIGINFO 1
603603
union __sanitizer_siginfo {
604+
# ifdef __clang__
605+
# pragma clang diagnostic push
606+
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
607+
# endif
604608
struct {
605609
int si_signo;
606610
# if SANITIZER_MIPS
@@ -611,6 +615,9 @@ union __sanitizer_siginfo {
611615
int si_code;
612616
# endif
613617
};
618+
# ifdef __clang__
619+
# pragma clang diagnostic pop
620+
# endif
614621
__sanitizer_siginfo_pad pad;
615622
};
616623
#else

0 commit comments

Comments
 (0)