This is the mail archive of the gcc-patches@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: Patch to allow Ada to work with tree-ssa


Richard Kenner wrote:
so it's an accident then? why not just remove it?

I'm not at all convinced it's an "accident".
I was using sarcasm.

The GNU C extensions
were never documented, but that doesn't mean that nobody used them.
The code I showed is just a logical consequence of the existance of
those extensions.  I've certainly known that it will work for quite
some time, perhaps as long as 20 years.  There's no way to know how
much code that depends on this is out there.
this is my point. What is the point of this extension?
* It's not documented, so users have no formal knowledge of its existance
* It's not documented, so users have no guarantee that it'll continue to work
* IMO, it's marginally useful to have a variable length array in the *middle*
of a C structure -- I notice PR2939' example is a structure with a trailing
array, which I consider to be significantly different, there being no
varying field offsets to consider (but it's still not documented to work).

Surely a more common need for variable length arrays is to support
multidimensional array parameters with something like,
  void Foo (int n, int m, int ary[n][m]);
Heck, that's even been codified in C99 (with slightly different syntax IIRC).
That would have more uptake in the field and IMO would have been a better
use of GCC developer time.

I'll repeat now what I said a few weeks ago: it's precisely because of
these things already being in GCC that the GNAT project chose GCC to
use as a backend.
Then you should take the opportunity to document it, as it's become an
undocumented requirement of GNAT.

In any event, there's no reason to remove this since we can easily support it.
Then document it. And the fact that it didn't work properly, and you're having
such grief getting it working seems to imply 'easily support' is not actually
true.

I'd like to know how many real (not a testcase) GNU C programs out there use
this varray-in-middle idiom (really, I would).

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



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