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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #2)
> Iff only (GNU) C would accept the following ...
> 
> struct foo {
>     ...
>     unsigned int count;
>     ...
>     int data[count];
> };

Well, that I think conflicts with the variable length structures GNU extension,
where
if the array size of a field isn't a constant expression, it is an expression
evaluated at runtime once (SAVE_EXPR) to determine the field size.
Here we are talking about something similar to what Fortran wants with its
deferred length arrays, essentially to have the size evaluated each time it is
accessed.
With the data[count] form even if it would be disambiguated the question is if
we want to otherwise treat it like normal flexible array member e.g. for sizeof
etc. and only treat it specially for __bdos, or if it would affect say sizeof
too.
I don't see how sizeof (struct foo) could be treated differently from flexible
array member, because one doesn't have an object on which count can be
evaluated, but perhaps
struct foo f;
f.count = 24;
sizeof (f.data) could change.

Reply via email to