From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jH3y9-0007yC-Df for mharc-grub-devel@gnu.org; Wed, 25 Mar 2020 07:13:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39542) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jH3y6-0007wo-Lo for grub-devel@gnu.org; Wed, 25 Mar 2020 07:13:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jH3y5-0000RG-JJ for grub-devel@gnu.org; Wed, 25 Mar 2020 07:13:06 -0400 Received: from mout.gmx.net ([212.227.15.15]:57041) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jH3y5-0000QG-5d for grub-devel@gnu.org; Wed, 25 Mar 2020 07:13:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1585134777; bh=Tfgr48xp0kwyi/fpwMGN2L+FFOBnyEGsQ/ZfZlDHEnM=; h=X-UI-Sender-Class:Date:From:To:Subject:Cc:References:In-Reply-To; b=XxwJlzd88ym1ohpcJdxfM6fW4wRxtvDpLJ5fz0TtPwdbVhw5cyWzLboByNXpU5fj8 TLkVpToDNngjbAUnejSK8Kid9n/bWK4ws5LF/withFtj6tRWQ5vQnsr9jX+XmrxSgo 16hnhf0PYPUHXNnp0GKtvkncg4SXyGYEHatqGkbI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from scdbackup.webframe.org ([91.8.163.58]) by mail.gmx.com (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxUnz-1jRy6b3oXh-00xw2j; Wed, 25 Mar 2020 12:12:56 +0100 Date: Wed, 25 Mar 2020 12:13:49 +0100 From: "Thomas Schmitt" To: grub-devel@gnu.org Subject: Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ... Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Cc: pmenzel@molgen.mpg.de References: <20200325072728.GA13446@mercury> In-Reply-To: <20200325072728.GA13446@mercury> Message-Id: <6700719198161959727@scdbackup.webframe.org> X-Provags-ID: V03:K1:9zpz+6sZ+V08Lh+9/eA2f+zR+2UIxsl4sR9M2eM4gAjxD1u+VMs sJGQWRvvSnG8FaAIpDarff2AbWEz7zAGR+la9BBRnKH8EmOqjoarbbt5vPwuAZMdfZXtYh4 S08pbSxVO5fTj9fviyPhzOarZUrvFGFPhrB+Si+GzfTlxV1MO3FWhlD1QJANgLDfBxTDNW0 6LMgeTV4k70O/tnzazUEw== X-UI-Out-Filterresults: notjunk:1;V03:K0:AewIV3LQpXU=:R4ikpENGsMLJ0xJuJDiafA M4PleE1CM9o6i9zimt00OzodeYhkZQUpUg0Do/nr/mHcu4ogVmVcd5LO7GYEJoTHH7J9HEJGG yLDZl71TW97xGU9eNWvoyrJ3rJRGbG2NEiesoRFEQfvRA+juUN4gbnT94nfJodHXEMAkqnyAP Vc+VEnaboQd7KYTFXKA8ThHnuCo2JXbg1PPVWBRzPqTvvXxcNtLOU6ByQR1pt70GjNKxgLnz5 y+PipyXCpD2LcD/Ow0Pb90JsCrTwkJOFIp0q2LHO7cranuBLDtzJH++IGbZO7gMuJBfqBcpDj ezTyAQ1XGLLFQ4i1Zjx/yclpQkCrpMlOBh/rmOKJqeU2lIr3paD7w31NulGiJRRiwD49vcrgl xFjzSJeYgalluCCc9JI7OPVAMIg9DeKRZvRDmIxw0WKgzF3W5bBhJAuf4NoiLtX9IsMUZUbFM xMGC3IJMbMMzGjiztiOiDkr6E05gp2XcPiEHqGRKYpnQgnoKoRykgv+LjGxjVWvU++jHsRJMv Y2XCqcpEGqs9VQMjh75GH5JYl+JpDnyRMnj5XaNTUp7u/NCptHade0cb1CTWA2uwmlVNStr9X ziWY09C6XsXRTJ2qLgZu6p7oonL8KYJCfhbNVrgz/BA5M0NgFOK3HnY8z63VkOryl1z+Lc+mR RNdRWmXD+VdGbouG0Ia+m3Vh0ry+1QgCgbfivB1qeQn7TPaxUrLr6a0viNX8T8QU+FkMebDdd sJHnxUBx5wiuQ9c+5pnJGiAcpWjdt1BBfdx582tCT8B34UCPbsOmpKIpQ7yn+ltnyVHxxgRhX y4M2ah1iJ91IYME3vxebviKcYdqiDJwl5GfIpaj9z6IjFmV4uc0V1RykmzEdGJfgSMZRsInGh lexs1dGQ107yitAJW7tn5/6dNXC9dVVn5KT7UJwpGQYswsqb9AshSBr/hRCzHdkPd+Os0wbMk rDOJDn/9UbaSOpu5zYjSlLY0eZuy78r4XrtFwHfjR0uVG9CsgWtuYKzaxSZnSkRS6wPgdo9FN 81fjnaKysrHIlSW1X11UHJNQiLXImdLhcIAfeVO2ApoK/qGyXDgkc48rJu+ovzZChkeRIf0V4 01LRyo8HjDkWUKrkTv5Khke5A7vzdrsh8WPx8ZZCK4/kJrRBbAIba60/HeyZymAEGPAQYW4gw uleMvKh7tD7uQRMxSHKU1J25kgOzsBrE4oOSsqTtbegZdJj3oKvHa8Eo8uMchCRYL6X7UKfGv 6v5sTWRBHGAh+qYok X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2020 11:13:07 -0000 Hi, Michael Chang wrote in patch 2/2: > ../../grub-core/fs/zfs/zfs.c:2263:44: error: array subscript ''= is > outside the bounds of an interior zero-length array 'grub_uint16_t[0]' {= aka > 'short unsigned int[0]'} [-Werror=3Dzero-length-bounds] > [...] > The l_hash[0] is apparnetly an interior member to the enclosed structure > [...] the l_entries[0] is used to get proper alignment to access leaf ch= unks That's what i call a dirty hack. I wonder what gcc would say to a union of [0]-sized arrays as last member of the struct type: struct typedef struct zap_leaf_phys { ... union { grub_uint16_t l_hash[0]; grub_properly_aligned_t l_entries[0]; } l_; } zap_leaf_phys_t; Mine likes such a gesture, but it is way behind in respect to modern bitro= t. So in the end, your patch looks like the solid and unambiguous way to implement what is desired. > It would be great if you can help to test patch to solve the build > problem for gcc-10 in your system or not. Due to lack of modernity i can only contribute statements that the concepts and motivations of your two patches look good to me. (I also lack the occasion to test the two use cases. Just lurking here for grub-mkrescue issues, where i provide the last stag= e of packing up the ISO image.) Have a nice day :) Thomas