From 5e8f57c674e9f44b284818f3b897c54005d53329 Mon Sep 17 00:00:00 2001 From: Pavel Kozlov Date: Tue, 17 Oct 2023 16:45:56 +0400 Subject: 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 --- include/setjmp.h | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'include') diff --git a/include/setjmp.h b/include/setjmp.h index 27cac9500..e6f437b93 100644 --- a/include/setjmp.h +++ b/include/setjmp.h @@ -27,21 +27,7 @@ __BEGIN_DECLS #include /* Get `__jmp_buf'. */ -#include /* Get `__sigset_t'. */ - - -/* Calling environment, plus possibly a saved signal mask. */ -struct __jmp_buf_tag - { - /* NOTE: The machine-dependent definitions of `__sigsetjmp' - assume that a `jmp_buf' begins with a `__jmp_buf' and that - `__mask_was_saved' follows it. Do not move these members - or add others before it. */ - __jmp_buf __jmpbuf; /* Calling environment. */ - int __mask_was_saved; /* Saved the signal mask? */ - __sigset_t __saved_mask; /* Saved signal mask. */ - }; - +#include __BEGIN_NAMESPACE_STD -- cgit v1.2.3