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: error: array type has incomplete element type


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 
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_047.html>.

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/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


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