Re: [AD] Proposal: removal of zero-sized arrays

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> A wording mistake. "More generally, it is possible to
> statically-initialise structures that currently use zero-sized arrays
> [if we make the change]". This is because it is not always possible to
> statically initialise a zero-sized array (as we discovered with dat2c).

Ah! ok.

> NB: by zero-sized arrays, I mean whatever you want to call unsized
> arrays in terminal positions.

Let's call them ISO C99 flexible array members then.

So your proposal is to remove ISO C99 flexible array members from the
library, whose use is directly supported by all the compilers (except GCC
2.x for which there is the zero-sized array extension) but whose static
initialization is undefined by the Standard.

Here is IMHO a more correct list of advantages/disadvantages:

Advantages:
 - dat2c will work nicely :-)
 - more generally, it is possible to statically-initialise structures

Disadvantages:
 - makes the code a little more complicated
 - introduces an unnecessary indirection
 - breaks data locality

--
Eric Botcazou



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/