glibc/misc/sys
Joseph Myers 548f467fa1 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.
2020-10-30 22:25:42 +00:00
..
auxv.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
cdefs.h Avoid -Wstringop-overflow warning in pthread_cleanup_push macros 2020-10-30 22:25:42 +00:00
dir.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
file.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ioctl.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mman.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
param.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
queue.h [BZ #5779] 2008-03-05 05:50:39 +00:00
select.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
single_threaded.h Add the __libc_single_threaded variable 2020-07-06 11:15:58 +02:00
syslog.h Rename __LONG_DOUBLE_USES_FLOAT128 to __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI 2020-04-30 08:52:08 -05:00
sysmacros.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
uio.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
xattr.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00