summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/pthread/pthread.h
diff options
context:
space:
mode:
authorPavel Kozlov <pavel.kozlov@synopsys.com>2023-10-17 16:45:56 +0400
committerWaldemar Brodkorb <wbx@openadk.org>2023-10-28 10:11:47 +0200
commit5e8f57c674e9f44b284818f3b897c54005d53329 (patch)
tree6a50fdb5eb9da8a565ad2184dcbc9ceb6990812c /libpthread/nptl/sysdeps/pthread/pthread.h
parent8c2f6218f81ab5303e07bad4e13f181aa9581d92 (diff)
Fix -Warray-parameter warning for __sigsetjmp
Fix the [-Warray-parameter=] warning for __sigsetjmp generated by GCC 11 and later GCC versions: | | warning: argument 1 of type 'struct __jmp_buf_tag *' declared as a pointer [-Warray-parameter=] | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; | ... | note: previously declared as an array 'struct __jmp_buf_tag[1]' | extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask) | Use the same fix as in glibc. The fix is to move the struct __jmp_buf_tag definition to a separate bits/ header so it can be included in pthread.h, to allow to use an array (as in setjmp.h) rather than a pointer in the declaration. Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/pthread/pthread.h')
-rw-r--r--libpthread/nptl/sysdeps/pthread/pthread.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpthread/nptl/sysdeps/pthread/pthread.h b/libpthread/nptl/sysdeps/pthread/pthread.h
index 1fba7fca6..531e17322 100644
--- a/libpthread/nptl/sysdeps/pthread/pthread.h
+++ b/libpthread/nptl/sysdeps/pthread/pthread.h
@@ -28,6 +28,7 @@
#include <signal.h>
#include <bits/pthreadtypes.h>
#include <bits/setjmp.h>
+#include <bits/jmp_buf_tag.h>
#include <bits/wordsize.h>
#if defined _LIBC && ( defined IS_IN_libc || !defined NOT_IN_libc )
#include <bits/uClibc_pthread.h>
@@ -726,8 +727,7 @@ 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. */