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: C99 conformance bug in gcc-3.1


On 31-May-2002, Joseph S. Myers <jsm28@cam.ac.uk> wrote:
> Zero-sized array members *do* behave differently from flexible array
> members.  Zero-sized members can occur in the middle of structures,
> whereas we disallow this for flexible array members.  We only allow (as an
> extension) static initialization of flexible array members - users wanting
> that had to change their code from zero-sized arrays to flexible array
> members.  So it's natural to continue this by implementing the various
> other constraints (as unconditional hard errors, not pedwarns) for
> flexible array members only.

Well, those are differences in legality (and diagnostics),
not differences in behaviour.  Each different syntax
may give you a different subset of the available features,
but in cases where both are legal, the result is the same.
I suppose the differences between the two syntaxs could be
a little annoying and confusing, but this would certainly be
tolerable, IMHO.

Using different layouts for the different syntaxes would mean
that you get different results at run-time depending on which
syntax you used.  That would be much worse, IMHO.

> glibc uses the different variant features in its headers (depending on
> compiler version) as if they are compatible, so some care is needed in
> working out whether an ABI change to fix the layout for flexible array
> members would affect the structures used by glibc.

The Mercury runtime system does this too.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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