kdb_sysctl_trap: suppress gcc -Warray-bounds

gcc diagnosed a dereference of 0x10 with -Warray-bounds, which is
entirely sensible, except that this is a deliberate trap.  Throw gcc off
with a volatile pointer.

Reviewed by:	kib (previous version)
Differential Revision:	https://reviews.freebsd.org/D45917
This commit is contained in:
Ryan Libby 2024-07-09 10:58:21 -07:00
parent 2207aaba89
commit ff1c63671b

View file

@ -238,7 +238,7 @@ static int
kdb_sysctl_trap(SYSCTL_HANDLER_ARGS)
{
int error, i;
int *addr = (int *)0x10;
int *volatile addr = (int *)0x10;
error = sysctl_wire_old_buffer(req, sizeof(int));
if (error == 0) {