git: f4432625edd6 - main - acpica: Quiet a -Wdangling-pointer warning in AcpiUtInitStackPtrTrace.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Mon, 05 Dec 2022 00:30:35 UTC
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=f4432625edd64df94ce7c2a085f256dbc4d2b215

commit f4432625edd64df94ce7c2a085f256dbc4d2b215
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-12-05 00:28:59 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-12-05 00:28:59 +0000

    acpica: Quiet a -Wdangling-pointer warning in AcpiUtInitStackPtrTrace.
    
    This function intentionally saves a pointer to an on-stack variable in
    a global as a dubious way of reading the stack pointer.
    
    Reviewed by:    imp, emaste
    Differential Revision:  https://reviews.freebsd.org/D37535
---
 usr.sbin/acpi/acpidb/Makefile | 4 ++++
 usr.sbin/acpi/iasl/Makefile   | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/usr.sbin/acpi/acpidb/Makefile b/usr.sbin/acpi/acpidb/Makefile
index 892f1e8c0cdb..ca9c90f26469 100644
--- a/usr.sbin/acpi/acpidb/Makefile
+++ b/usr.sbin/acpi/acpidb/Makefile
@@ -90,3 +90,7 @@ LIBADD=	pthread
 .if ${COMPILER_TYPE} == "clang"
 CWARNFLAGS+=	-Wno-null-pointer-arithmetic
 .endif
+
+# AcpiUtInitStackPtrTrace intentionally leaks a pointer to an
+# on-stack variable.
+CWARNFLAGS.utdebug.c+= ${NO_WDANGLING_POINTER}
diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile
index 15b6d7a03c3d..6b95cc1d7457 100644
--- a/usr.sbin/acpi/iasl/Makefile
+++ b/usr.sbin/acpi/iasl/Makefile
@@ -147,4 +147,8 @@ prparserparse.c prparserparse.h: prparser.y
 prparser.y.h: prparserparse.h .NOMETA
 	ln -f ${.ALLSRC} ${.TARGET}
 
+# AcpiUtInitStackPtrTrace intentionally leaks a pointer to an
+# on-stack variable.
+CWARNFLAGS.utdebug.c+= ${NO_WDANGLING_POINTER}
+
 .include <bsd.prog.mk>