This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On 03/20/2017 05:51 PM, Jason Merrill wrote:
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
I meant that G++ accepts it, doesn't ICE, but emits wrong code. (it's consistently rejected by the C front end). Sorry for not being clear about it. Martin
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |