about summary refs log tree commit diff
path: root/soft-fp/soft-fp.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2020-10-30 22:25:42 +0000
committerJoseph Myers <joseph@codesourcery.com>2020-10-30 22:25:42 +0000
commit548f467fa14ffe7d955beeb31b30e2aeae4467e0 (patch)
tree110b58e4d121c3650cb103a883f02091d06c5e84 /soft-fp/soft-fp.h
parent882774658cb8daee4c16677a3fd674f6052cc157 (diff)
downloadglibc-548f467fa14ffe7d955beeb31b30e2aeae4467e0.tar.gz
glibc-548f467fa14ffe7d955beeb31b30e2aeae4467e0.tar.xz
glibc-548f467fa14ffe7d955beeb31b30e2aeae4467e0.zip
Avoid -Wstringop-overflow warning in pthread_cleanup_push macros
GCC 11 introduces a -Wstringop-overflow warning for calls to functions
with an array argument passed as a pointer to memory not large enough
for that array.  This includes the __sigsetjmp calls from
pthread_cleanup_push macros, because those use a structure in
__pthread_unwind_buf_t, which has a common initial subsequence with
jmp_buf but does not include the saved signal mask; this is OK in this
case because the second argument to __sigsetjmp is 0 so the signal
mask is not accessed.

To avoid this warning, use a function alias __sigsetjmp_cancel with
first argument an array of exactly the type used in the calls to the
function, if using GCC 11 or later.  With older compilers, continue to
use __sigsetjmp with a cast, to avoid any issues with compilers
predating the returns_twice attribute not applying the same special
handling to __sigsetjmp_cancel as to __sigsetjmp.

Tested with build-many-glibcs.py for arm-linux-gnueabi that this fixes
the testsuite build failures.
Diffstat (limited to 'soft-fp/soft-fp.h')
0 files changed, 0 insertions, 0 deletions