diff options
author | Joseph Myers <joseph@codesourcery.com> | 2020-10-05 16:46:46 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2020-10-05 16:46:46 +0000 |
commit | 19302b27bdacfe87e861ff46fc0fbad60dd6602d (patch) | |
tree | 9e97cb87089d1bd597ab6ba4fbea20bc556cd229 /sysdeps | |
parent | 5bb2e5300b9b7cf1b8b7f2cbcbfca4d4a529082d (diff) | |
download | glibc-19302b27bdacfe87e861ff46fc0fbad60dd6602d.tar glibc-19302b27bdacfe87e861ff46fc0fbad60dd6602d.tar.gz glibc-19302b27bdacfe87e861ff46fc0fbad60dd6602d.tar.bz2 glibc-19302b27bdacfe87e861ff46fc0fbad60dd6602d.zip |
Fix GCC 11 -Warray-parameter warning for __sigsetjmp (bug 26647)
This patch fixes part of bug 26647 (-Werror=array-parameter error
building with GCC 11 because of __sigsetjmp being declared using an
array parameter in one header and a pointer parameter in another).
The fix is to split the struct __jmp_buf_tag definition out to a
separate bits/types/ header so it can be included in pthread.h, so
that pthread.h can declare __sigsetjmp with the type contents visible,
so can use an array (as in setjmp.h) rather than a pointer in the
declaration.
Note that several other build failures with GCC 11 remain. This does
not fix the jmp_buf-related -Wstringop-overflow errors (also discussed
in bug 26647), or -Warray-parameter errors for other functions (bug
26686), or -Warray-bounds errors (bug 26687).
Tested, with older compilers, natively for x86_64 and with
build-many-glibc.py for aarch64-linux-gnu. Tested with
build-many-glibcs.py with GCC mainline for aarch64-linux-gnu that this
gets past the -Warray-parameter issue for __sigsetjmp (with the next
build failure being the other one discussed in bug 26647).
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/nptl/pthread.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/nptl/pthread.h b/sysdeps/nptl/pthread.h index 8a403cbf36..d4194da776 100644 --- a/sysdeps/nptl/pthread.h +++ b/sysdeps/nptl/pthread.h @@ -28,6 +28,7 @@ #include <bits/wordsize.h> #include <bits/types/struct_timespec.h> #include <bits/types/__sigset_t.h> +#include <bits/types/struct___jmp_buf_tag.h> /* Detach state. */ @@ -730,8 +731,8 @@ extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) #endif /* Function used in the macros. */ -struct __jmp_buf_tag; -extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; +extern int __sigsetjmp (struct __jmp_buf_tag __env[1], + int __savemask) __THROWNL; /* Mutex handling. */ |