This is the mail archive of the
mailing list for the GCC project.
Re: error: array type has incomplete element type
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- Cc: GCC List <gcc at gcc dot gnu dot org>, Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Date: Wed, 2 Feb 2005 12:41:47 +0000 (UTC)
- Subject: Re: error: array type has incomplete element type
- References: <firstname.lastname@example.org>
On Wed, 2 Feb 2005, Ralf Corsepius wrote:
> * What is wrong with such kind of declarations?
Arrays are of object types only. Incomplete types are not object types.
> Has the language changed, have constructs like the one above been
> obsoleted by C-standards or did the code implicitly rely on a gcc
> proprietary extension to C?
It has been confirmed since 1992 that such declarations are not valid C
The extension *didn't work*: in some cases, using it caused an internal
compiler error; see bug 19333 and the discussion on gcc-patches linked
from there. In any case, you can't rely on undocumented extensions to
stay around or have a deprecation period when removed. (Documented
extensions will normally have a deprecation period, unless it turns out
that they were already broken in previous releases and so cannot have
users relying on them.)
If you find yourself relying on an undocumented extension and don't want
it to vanish suddenly, you can of course submit a patch to the
documentation and testsuite to turn it into a documented, tested
extension. This may however promote debate as to whether the extension is
indeed desirable and lead to it being removed sooner than had you not
posted the patch.
Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/
email@example.com (personal mail)
firstname.lastname@example.org (CodeSourcery mail)
email@example.com (Bugzilla assignments and CCs)