public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Martin Sebor <msebor@gmail.com>
Cc: Gcc Patch List <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] have chkp skip flexible member arrays (PR #79986)
Date: Mon, 20 Mar 2017 23:51:00 -0000	[thread overview]
Message-ID: <CADzB+2kHKCgq2AFZHWHBLN4HivkDqmERqr424SWKx-iyk4y5Rg@mail.gmail.com> (raw)
In-Reply-To: <4c6d8cdd-46f8-216d-56cb-07a74284f69a@gmail.com>

On Mon, Mar 20, 2017 at 7:04 PM, Martin Sebor <msebor@gmail.com> wrote:
> Attached is a minimal patch to avoid an ICE in CHKP upon
> encountering one form of an initializer for a flexible array
> member, specifically the empty string:
>
>   int f ()
>   {
>     struct B { int n; char a[]; };
>
>     return ((struct B){ 1, "" }).a[0];
>   }
>
> Although GCC accepts (and doesn't ICE on) non-empty initializers
> for flexible array members, such as
>
>     (struct B){ 1, "123" }

How do you mean?  When I compile this with the C front end, I get

error: non-static initialization of a flexible array member

Jason

  reply	other threads:[~2017-03-20 23:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-20 23:04 Martin Sebor
2017-03-20 23:51 ` Jason Merrill [this message]
2017-03-20 23:58   ` Martin Sebor
2017-03-21  4:27     ` Jason Merrill
2017-03-21 15:08       ` Martin Sebor
2017-03-21 15:15         ` Jakub Jelinek
2017-03-21 15:17           ` Jeff Law
2017-03-21 15:46         ` Marek Polacek
2017-03-21 23:56           ` Martin Sebor
2017-03-21 19:33         ` Jason Merrill
2017-03-29 23:29           ` Martin Sebor
2017-04-07 16:50             ` Jason Merrill

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=CADzB+2kHKCgq2AFZHWHBLN4HivkDqmERqr424SWKx-iyk4y5Rg@mail.gmail.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@gmail.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).