diff mbox series

use sigjmp_buf for analyzer sigsetjmp tests

Message ID orsg7ul81x.fsf@lxoliva.fsfla.org
State New
Headers show
Series use sigjmp_buf for analyzer sigsetjmp tests | expand

Commit Message

Alexandre Oliva Dec. 25, 2020, 6:21 a.m. UTC
The sigsetjmp analyzer tests use jmp_buf in sigsetjmp and siglongjmp
calls.  Not every system that supports sigsetjmp uses the same data
structure for setjmp and sigsetjmp, which results in type mismatches.

This patch changes the tests to use sigjmp_buf, that is the
POSIX-specific type for use with sigsetjmp and siglongjmp.

Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
Ok to install?


for  gcc/testsuite/ChnageLog

	* gcc.dg/analyzer/sigsetjmp-5.c: Use sigjmp_buf.
	* gcc.dg/analyzer/sigsetjmp-6.c: Likewise.
---
 gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c |    2 +-
 gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

David Malcolm Jan. 13, 2021, 9:51 p.m. UTC | #1
On Fri, 2020-12-25 at 03:21 -0300, Alexandre Oliva wrote:
> The sigsetjmp analyzer tests use jmp_buf in sigsetjmp and siglongjmp
> calls.  Not every system that supports sigsetjmp uses the same data
> structure for setjmp and sigsetjmp, which results in type mismatches.
> 
> This patch changes the tests to use sigjmp_buf, that is the
> POSIX-specific type for use with sigsetjmp and siglongjmp.
> 
> Regstrapped on x86_64-linux-gnu, also tested on arm-vxworks7r2.
> Ok to install?
> 

Sorry about the mistake.

The patch looks good to me; I think you can install this under the
 "obvious" rule.

Thanks
Dave
>
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
index d6a9910478ce4..494b81352a395 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-5.c
@@ -4,7 +4,7 @@ 
 #include <stddef.h>
 #include "analyzer-decls.h"
 
-static jmp_buf env;
+static sigjmp_buf env;
 
 static void inner (void)
 {
diff --git a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
index f89277efc4847..f5507a3618926 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sigsetjmp-6.c
@@ -6,7 +6,7 @@ 
 
 extern int foo (int) __attribute__ ((__pure__));
 
-static jmp_buf env;
+static sigjmp_buf env;
 
 static void inner (void)
 {