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

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.


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