git: ff01fd164655 - stable/13 - Disable errors for -Wnonnull for the kernel for GCC 12.

From: John Baldwin <jhb_at_FreeBSD.org>
Date: Wed, 03 May 2023 00:29:43 UTC
The branch stable/13 has been updated by jhb:

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

commit ff01fd164655b1ec9d0455c6a42ec5218a30b368
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-12-21 18:46:06 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-05-03 00:11:57 +0000

    Disable errors for -Wnonnull for the kernel for GCC 12.
    
    The USB code and some other places raise false positives when a NULL
    pointer is passed to an inlined function along with a separate length
    and the compiler can't determine that the separate length of 0
    prevents the use of the NULL pointer.
    
    Differential Revision:  https://reviews.freebsd.org/D37627
    
    (cherry picked from commit 488c498b099e3f48db4048833d2b0d03d7bed3e1)
---
 sys/conf/kern.mk | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index bed235cf1afe..5d902b340c2b 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -90,6 +90,9 @@ CWARNEXTRA+=	-Wno-error=packed-not-aligned
 .if ${COMPILER_VERSION} >= 90100
 CWARNEXTRA+=	-Wno-address-of-packed-member			\
 		-Wno-error=alloca-larger-than=
+.if ${COMPILER_VERSION} >= 120100
+CWARNEXTRA+=	-Wno-error=nonnull
+.endif
 .endif
 
 # GCC produces false positives for functions that switch on an