From: "Thomas Schmitt" <scdbackup@gmx.net>
To: grub-devel@gnu.org
Cc: pmenzel@molgen.mpg.de
Subject: Re: disk/mdraid1x_linux.c:181:15: warning: array subscript ...
Date: Wed, 25 Mar 2020 12:13:49 +0100 [thread overview]
Message-ID: <6700719198161959727@scdbackup.webframe.org> (raw)
In-Reply-To: <20200325072728.GA13446@mercury>
Hi,
Michael Chang wrote in patch 2/2:
> ../../grub-core/fs/zfs/zfs.c:2263:44: error: array subscript '<unknown>' is
> outside the bounds of an interior zero-length array 'grub_uint16_t[0]' {aka
> 'short unsigned int[0]'} [-Werror=zero-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 chunks
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 bitrot.
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 stage
of packing up the ISO image.)
Have a nice day :)
Thomas
next prev parent reply other threads:[~2020-03-25 11:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-24 4:00 grub/head build with pre-release GCC10 ; fail @ "grub-core/disk/mdraid1x_linux.c:181:15: error: ..." PGNet Dev
2020-03-24 14:51 ` Paul Menzel
2020-03-24 16:52 ` PGNet Dev
2020-03-24 17:04 ` PGNet Dev
2020-03-24 17:54 ` disk/mdraid1x_linux.c:181:15: warning: array subscript Thomas Schmitt
2020-03-25 7:27 ` Michael Chang
2020-03-25 11:13 ` Thomas Schmitt [this message]
2020-03-26 3:08 ` Michael Chang
2020-03-25 15:35 ` PGNet Dev
2020-03-25 15:52 ` Paul Menzel
2020-03-25 15:54 ` PGNet Dev
2020-03-25 16:08 ` Paul Menzel
2020-03-26 3:29 ` Michael Chang
2020-03-26 4:05 ` PGNet Dev
2020-03-25 18:35 ` Daniel Kiper
2020-03-26 4:13 ` Michael Chang
2020-03-26 4:24 ` Michael Chang
-- strict thread matches above, loose matches on Subject: below --
2020-03-20 8:24 disk/mdraid1x_linux.c:181:15: warning: array subscript <unknown> is outside array bounds of ‘grub_uint16_t[0]’ {aka ‘short unsigned int[0]’} [-Warray-bounds] Paul Menzel
2020-03-20 13:05 ` disk/mdraid1x_linux.c:181:15: warning: array subscript Thomas Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6700719198161959727@scdbackup.webframe.org \
--to=scdbackup@gmx.net \
--cc=grub-devel@gnu.org \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.