Skip to content

Commit 9d15fc0

Browse files
committed
Quick fix for a waning in clang_rt.ctx_profile [-Wgnu-anonymous-struct]
`__sanitizer_siginfo` has been introduced in D142117. (llvmorg-16-init-17950-ged9ef9b4f248) It is incompatible to -pedantic. `clang_rt.ctx_profile` has been introduced in #92456.
1 parent f87ed54 commit 9d15fc0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

compiler-rt/cmake/config-ix.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ check_cxx_compiler_flag("-Werror -Wframe-larger-than=512" COMPILER_RT_HAS_WFRAME
127127
check_cxx_compiler_flag("-Werror -Wglobal-constructors" COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG)
128128
check_cxx_compiler_flag("-Werror -Wc99-extensions" COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG)
129129
check_cxx_compiler_flag("-Werror -Wgnu" COMPILER_RT_HAS_WGNU_FLAG)
130+
check_cxx_compiler_flag("-Werror -Wgnu-anonymous-struct" COMPILER_RT_HAS_WGNU_ANONYMOUS_STRUCT_FLAG)
130131
check_cxx_compiler_flag("-Werror -Wvariadic-macros" COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG)
131132
check_cxx_compiler_flag("-Werror -Wunused-parameter" COMPILER_RT_HAS_WUNUSED_PARAMETER_FLAG)
132133
check_cxx_compiler_flag("-Werror -Wcovered-switch-default" COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG)

compiler-rt/lib/ctx_profile/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ include_directories(../../include)
1515
# We don't use the C++ Standard Library here, so avoid including it by mistake.
1616
append_list_if(COMPILER_RT_HAS_NOSTDINCXX_FLAG -nostdinc++ EXTRA_FLAGS)
1717

18+
# __sanitizer_siginfo
19+
append_list_if(COMPILER_RT_HAS_WGNU_ANONYMOUS_STRUCT_FLAG -Wno-gnu-anonymous-struct EXTRA_FLAGS)
20+
1821
if(COMPILER_RT_INCLUDE_TESTS)
1922
add_subdirectory(tests)
2023
endif()

0 commit comments

Comments
 (0)