This is the mail archive of the gcc-bugs@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]

[Bug testsuite/39550] compat tests for flexible array members



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]