]> Savannah Git Hosting - gnulib.git/commitdiff
sigsegv-tests: port to GCC 14
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 21 Sep 2024 02:24:39 +0000 (19:24 -0700)
committerBruno Haible <bruno@clisp.org>
Tue, 1 Oct 2024 21:01:06 +0000 (23:01 +0200)
GCC 14 on x86-64 with -O2 apparently outsmarts our test for null
pointer dereference, and this is something the C standard allows.
Fix the test by putting ‘volatile’ at the right place.
* tests/test-sigsegv-catch-stackoverflow2.c (null_pointer):
Make it a volatile pointer, not a pointer to volatile.
Also, rename from null_pointer_to_volatile_int; use changed.

ChangeLog
tests/test-sigsegv-catch-stackoverflow2.c

index 9426e7dd9f37a74048dc672255d5421f621d7abf..5f0dcc0240d5ed86b183aa060206fae5dbc48848 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-09-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       sigsegv-tests: port to GCC 14
+       GCC 14 on x86-64 with -O2 apparently outsmarts our test for null
+       pointer dereference, and this is something the C standard allows.
+       Fix the test by putting ‘volatile’ at the right place.
+       * tests/test-sigsegv-catch-stackoverflow2.c (null_pointer):
+       Make it a volatile pointer, not a pointer to volatile.
+       Also, rename from null_pointer_to_volatile_int; use changed.
+
 2024-09-20  Bruno Haible  <bruno@clisp.org>
 
        jit/cache tests: Fix crash with clang's UBSAN + ASAN.
index 60f7eb0cfbcac43a6fb361b38e126f0150467ab8..133b616af2165349a2dd56b7943c32b9e0b640d1 100644 (file)
@@ -59,7 +59,7 @@ static sigset_t mainsigset;
 
 static volatile int pass = 0;
 static uintptr_t page;
-static volatile int *null_pointer_to_volatile_int /* = NULL */;
+static int *volatile null_pointer /* = NULL */;
 
 static void
 stackoverflow_handler_continuation (void *arg1, void *arg2, void *arg3)
@@ -193,7 +193,7 @@ main ()
       *(volatile int *) (page + 0x678) = 42;
       break;
     case 3:
-      *null_pointer_to_volatile_int = 42;
+      *null_pointer = 42;
       break;
     case 4:
       break;