Clang fails to compile a number of files with the following warning:
indirection of non-volatile null pointer will be deleted, not trap
[-Wnull-dereference]. This commit qualifies the relevant pointers
with 'volatile'.
gdb/testsuite/ChangeLog:
* gdb.base/bigcore.c (main): Use a volatile pointer when
attempting to trigger a SIGSEGV.
* gdb.base/gcore-relro-pie.c (break_here): Likewise.
* gdb.base/gcore-tls-pie.c (break_here): Likewise.
* gdb.base/savedregs.c (thrower): Likewise.
* gdb.mi/mi-syn-frame.c (bar): Likewise.
+2020-07-13 Gary Benson <gbenson@redhat.com>
+
+ * gdb.base/bigcore.c (main): Use a volatile pointer when
+ attempting to trigger a SIGSEGV.
+ * gdb.base/gcore-relro-pie.c (break_here): Likewise.
+ * gdb.base/gcore-tls-pie.c (break_here): Likewise.
+ * gdb.base/savedregs.c (thrower): Likewise.
+ * gdb.mi/mi-syn-frame.c (bar): Likewise.
+
2020-07-13 Gary Benson <gbenson@redhat.com>
* gdb.base/vla-datatypes.c (vla_factory): Factor out sections
/* Push everything out to disk. */
print_string ("Dump core ....\n");
- *(char*)0 = 0;
+ *(volatile char*)0 = 0;
}
void
break_here (void)
{
- *(int *) 0 = 0;
+ *(volatile int *) 0 = 0;
}
void
void
break_here (void)
{
- *(int *) 0 = 0;
+ *(volatile int *) 0 = 0;
}
void
thrower (void)
{
/* Trigger a SIGSEGV. */
- *(char *)0 = 0;
+ *(volatile char *)0 = 0;
/* On MMU-less system, previous memory access to address zero doesn't
trigger a SIGSEGV. Trigger a SIGILL. Each arch should define its
void
bar (void)
{
- *(char *)0 = 0; /* try to cause a segfault */
+ *(volatile char *)0 = 0; /* try to cause a segfault */
/* On MMU-less system, previous memory access to address zero doesn't
trigger a SIGSEGV. Trigger a SIGILL. Each arch should define its