Skip to content

Commit 12101ca

Browse files
[libc] set -Wno-frame-address for thread.cpp (#77140)
The aarch64 code is using __builtin_return_address with a non-zero parameter, which generates the following warning: llvm-project/libc/src/__support/threads/linux/thread.cpp:171:38: error: calling '__builtin_frame_address' with a nonzero argument is unsafe [-Werror,-Wframe-address] 171 | return reinterpret_cast<uintptr_t>(__builtin_frame_address(1)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~ Disable this diagnostic just for this file so that we can enable -Werror. Fixes: #77007
1 parent ff47989 commit 12101ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libc/src/__support/threads/linux/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ add_object_library(
3939
-O3
4040
-fno-omit-frame-pointer # This allows us to sniff out the thread args from
4141
# the new thread's stack reliably.
42+
-Wno-frame-address # Yes, calling __builtin_return_address with a
43+
# value other than 0 is dangerous. We know.
4244
)
4345

4446
add_object_library(

0 commit comments

Comments
 (0)