http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36839
Marek Polacek changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
CC|
--- Comment #5 from joseph at codesourcery dot com 2009-02-27 20:58 ---
Subject: Re: struct with only anonymous unions plus flexible
array member
Anonymous unions are outside the scope of C99, so this issue is purely
about what is most useful for GNU C right now.
However, there have
--- Comment #4 from vegard dot nossum at gmail dot com 2009-02-27 20:32
---
Workaround:
Install an empty dummy member between the union and the array, like this:
struct x {
union {
int x;
};
int _dummy[0]; // workaround
int array[];
};
--- Comment #3 from vegard dot nossum at gmail dot com 2009-02-27 20:27
---
I'm hitting this as well :-(
[veg...@damson ~/programming 0]
$ cat flexible-array-empty-struct.c
struct x {
union {
int x;
};
int array[];
};
[veg...@damson ~/programm
--- Comment #2 from pinskia at gcc dot gnu dot org 2008-12-27 20:45 ---
http://gcc.gnu.org/ml/gcc-patches/2001-01/msg00357.html
Hmm, this is on purpose as far as I can tell.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36839
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-27 20:31 ---
else if (!saw_named_field)
{
error ("%Jflexible array member in otherwise empty struct", x);
TREE_TYPE (x) = error_mark_node;
}
Hmm, it explicitly look