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]

Re: Should structure with flexible array be allowed to be passed by value?


Brian Ellis wrote:
> struct dynamic { int size; int array[]; };

> int main() { struct dynamic * pBadness =  ((struct dynamic *) malloc(
> sizeof(int) * 3) );

> dont_do_this( *pBadness );


  Are you even allowed to dereference a pointer to a struct containing a VLA?
 Should it be treated like an incomplete type in this respect?

    cheers,
      DaveK


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