This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug testsuite/39550] compat tests for flexible array members
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2009 00:40:17 -0000
- Subject: [Bug testsuite/39550] compat tests for flexible array members
- References: <bug-39550-230@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from hjl dot tools at gmail dot com 2009-03-25 00:40 -------
Flexible array member isn't allowed in union:
[hjl@gnu-34 pr39545]$ cat u-1.i
union line {
int length;
char contents[];
};
void foo (union line);
union line
bar ()
{
union line x;
x.length = sizeof (union line);
foo (x);
return x;
}
[hjl@gnu-34 pr39545]$ gcc -S u-1.i
u-1.i:3: error: flexible array member in union
[hjl@gnu-34 pr39545]$
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39550