From: Jakub Jelinek <jakub@redhat.com>
To: Qing Zhao <qing.zhao@oracle.com>
Cc: gcc-patches Paul A Clarke via <gcc-patches@gcc.gnu.org>,
kees Cook <keescook@chromium.org>,
Martin Sebor <msebor@gmail.com>
Subject: Re: [GCC 13][PATCH] PR101836: Add a new option -fstrict-flex-array[=n] and use it in __builtin_object_size
Date: Tue, 28 Jun 2022 18:43:30 +0200 [thread overview]
Message-ID: <YrsvsoTparTlXUq2@tucnak> (raw)
In-Reply-To: <2DDA999B-58B1-4390-9E2E-C4D68C0FD913@oracle.com>
On Tue, Jun 28, 2022 at 03:59:22PM +0000, Qing Zhao via Gcc-patches wrote:
> > On Jun 28, 2022, at 11:08 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> >
> > On Tue, Jun 28, 2022 at 03:03:12PM +0000, Qing Zhao wrote:
> >> 2. Then replace all “array_at_struct_end_p” with using DECL_NOT_FLEXARRAY in GCC, adding new testing cases
> >
> > No, IMHO array_at_struct_end_p should stay as is, just test this extra flag
> > too.
>
> Could you please explain why we still need “array_at_struct_end_p” after we have the DECL_NOT_FLEXARRAY flag in FIELD_DECL?
Because the flag just tells whether some array shouldn't be treated as (poor man's)
flexible array member. We still need to find out if some FIELD_DECL is to
be treated like a flexible array member, which is a minority of
COMPONENT_REFs.
struct S { int a; char b[0]; int c; } s;
struct T { int d; char e[]; };
struct U { int f; struct T g; int h; } u;
Neither s.b nor u.g.e is to be treated like flexible array member,
no matter what -fstrict-flex-array= option is used.
Jakub
next prev parent reply other threads:[~2022-06-28 16:43 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 14:19 Qing Zhao
2022-06-28 7:16 ` Richard Biener
2022-06-28 15:03 ` Qing Zhao
2022-06-28 15:08 ` Jakub Jelinek
2022-06-28 15:59 ` Qing Zhao
2022-06-28 16:43 ` Jakub Jelinek [this message]
2022-06-28 18:15 ` Qing Zhao
2022-06-28 18:22 ` Jakub Jelinek
2022-06-28 18:29 ` Qing Zhao
2022-06-28 18:49 ` Jakub Jelinek
2022-06-28 19:01 ` Qing Zhao
2022-06-29 21:14 ` Martin Sebor
2022-06-30 14:07 ` Qing Zhao
2022-06-30 14:24 ` Richard Biener
2022-06-30 15:31 ` Qing Zhao
2022-06-30 17:03 ` Jakub Jelinek
2022-06-30 19:30 ` Qing Zhao
2022-07-01 6:49 ` Richard Biener
2022-07-01 12:55 ` Qing Zhao
2022-07-01 12:58 ` Richard Biener
2022-07-01 13:40 ` Qing Zhao
2022-07-01 12:59 ` Jakub Jelinek
2022-07-01 14:01 ` Qing Zhao
2022-07-01 15:32 ` Martin Sebor
2022-07-04 6:49 ` Richard Biener
2022-07-06 14:20 ` Qing Zhao
2022-07-07 8:02 ` Richard Biener
2022-07-07 13:33 ` Qing Zhao
2022-06-29 20:45 ` Qing Zhao
2022-06-28 16:21 ` Martin Sebor
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=YrsvsoTparTlXUq2@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=keescook@chromium.org \
--cc=msebor@gmail.com \
--cc=qing.zhao@oracle.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).