https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108896

--- Comment #30 from qinzhao at gcc dot gnu.org ---
(In reply to Martin Uecker from comment #28)

> The problems with VLA are in my opinion caused by poor
> implementation (e.g. no stack probing etc) and bad
> code generation (Linus was not happy about this) and
> not because anything is fundamentally bad about them
> from the point of language semantics.

you mean gcc's implementation? how about other compilers?

> VM = variably modified.  In C it is a type which is derived from
> a VLA which is not necessarily itself a VLA, e.g. a pointer to
> a VLA. But a VLA is also a VM type.

Okay.
> 
> > struct foo {
> >   int len;
> >   char (*buf)[.len];
> > };
> > 
> > 
> > This has less issues because the size of the struct then does not depend
> > on the length.

but I am still not clear on why "the size of the above struct 'foo' does not
depend on the .len?"  in my opinion, it should depend on .len. do I miss
anything here?

Reply via email to