From owner-dev-commits-src-main@freebsd.org Tue Dec 29 21:30:37 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCA3C4CB932; Tue, 29 Dec 2020 21:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D56z151Yvz3Qmf; Tue, 29 Dec 2020 21:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F3C712AFB; Tue, 29 Dec 2020 21:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BTLUb6o078921; Tue, 29 Dec 2020 21:30:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BTLUbGo078920; Tue, 29 Dec 2020 21:30:37 GMT (envelope-from git) Date: Tue, 29 Dec 2020 21:30:37 GMT Message-Id: <202012292130.0BTLUbGo078920@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Toomas Soome Subject: git: 40c4557bee27 - main - cxgbe: replace zero sized array by flexible array MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tsoome X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40c4557bee27adb15bb376803dffbcd6de323b8a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 21:30:37 -0000 The branch main has been updated by tsoome: URL: https://cgit.FreeBSD.org/src/commit/?id=40c4557bee27adb15bb376803dffbcd6de323b8a commit 40c4557bee27adb15bb376803dffbcd6de323b8a Author: Toomas Soome AuthorDate: 2020-12-29 20:59:01 +0000 Commit: Toomas Soome 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 };