This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Should structure with flexible array be allowed to be passed by value?
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: "gcc at gnu dot org" <gcc at gnu dot org>
- Date: Tue, 24 Mar 2009 08:00:41 -0700
- Subject: Should structure with flexible array be allowed to be passed by value?
Gcc supports zero-length array:
http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Zero-Length.html#Zero-Length
Should
struct line {
int length;
char contents[0];
};
or
struct line {
int length;
char contents[];
};
be allowed to be passed by value? If yes, how do you access the contents field?
--
H.J.