Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 May 2023 00:29:47 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 0f8e9a76f304 - stable/13 - Disable -Wzero-length-bounds for the kernel for GCC 12.
Message-ID:  <202305030029.3430Tl49072156@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by jhb:

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

commit 0f8e9a76f3045855d099bb9fa89684016822f242
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-12-21 18:47:08 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2023-05-03 00:13:25 +0000

    Disable -Wzero-length-bounds for the kernel for GCC 12.
    
    The mlx5 driver and some other OFED bits use a somewhat dubious
    pattern of:
    
      struct foo {
          uint64_t arg[0];
          /* Real members of a struct */
      };
    
    The code then treats 'arg' as if it were really a kind of union
    such that foo.arg[N] functions similarly to (uint64_t *)foo[N].
    This uses of foo.arg[N] then trigger this warning.
    
    No real bugs were found by this warning though, so just turn it off
    globally.
    
    Reviewed by:    hselasky, kib
    Differential Revision:  https://reviews.freebsd.org/D37630
    
    (cherry picked from commit 1aa6d44decb33ce3eab0efe5336b75fa2dfa3733)
---
 sys/conf/kern.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sys/conf/kern.mk b/sys/conf/kern.mk
index b50c82b7d913..281c49c7c850 100644
--- a/sys/conf/kern.mk
+++ b/sys/conf/kern.mk
@@ -92,7 +92,8 @@ CWARNEXTRA+=	-Wno-address-of-packed-member			\
 		-Wno-error=alloca-larger-than=
 .if ${COMPILER_VERSION} >= 120100
 CWARNEXTRA+=	-Wno-error=nonnull				\
-		-Wno-dangling-pointer
+		-Wno-dangling-pointer				\
+		-Wno-zero-length-bounds
 .endif
 .endif
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305030029.3430Tl49072156>