Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Dec 2020 21:30:37 GMT
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 40c4557bee27 - main - cxgbe: replace zero sized array by flexible array
Message-ID:  <202012292130.0BTLUbGo078920@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tsoome:

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

commit 40c4557bee27adb15bb376803dffbcd6de323b8a
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2020-12-29 20:59:01 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2020-12-29 21:09:15 +0000

    cxgbe: replace zero sized array by flexible array
    
    The issue was found while building cxgbe with gcc 10 (in illumos),
    the array subscription check is warning us about outside the bounds
    access.
    
    See also: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
---
 sys/dev/cxgbe/common/t4_msg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sys/dev/cxgbe/common/t4_msg.h b/sys/dev/cxgbe/common/t4_msg.h
index 447cc07b7dc5..143cec216423 100644
--- a/sys/dev/cxgbe/common/t4_msg.h
+++ b/sys/dev/cxgbe/common/t4_msg.h
@@ -2862,7 +2862,7 @@ struct ulptx_sgl {
 	__be32 len0;
 	__be64 addr0;
 #if !(defined C99_NOT_SUPPORTED)
-	struct ulptx_sge_pair sge[0];
+	struct ulptx_sge_pair sge[];
 #endif
 };
 
@@ -2876,7 +2876,7 @@ struct ulptx_isgl {
 	__be32 cmd_nisge;
 	__be32 rsvd;
 #if !(defined C99_NOT_SUPPORTED)
-	struct ulptx_isge sge[0];
+	struct ulptx_isge sge[];
 #endif
 };
 



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