This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
error: array type has incomplete element type
- From: Ralf Corsepius <ralf dot corsepius at rtems dot org>
- To: GCC List <gcc at gcc dot gnu dot org>
- Cc: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Date: Wed, 02 Feb 2005 13:21:23 +0100
- Subject: error: array type has incomplete element type
Hi,
Since recently (sometime between 20050125 and 20050201), gcc-4.0 rejects
this example:
# cat bla1.c
extern struct bla array[];
# gcc -c bla0.c
bla0.c:1: error: array type has incomplete element type
# gcc --version
gcc (GCC) 4.0.0 20050201 (experimental)
However, until a couple of days ago (and many years before), gcc had
accepted this code without any complaint (-pedantic had issued a
warning).
Questions:
* What is wrong with such kind of declarations?
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?
Technically, it is not obvious to me, why
extern struct bla array[];
is different from
extern struct bla *array;
* Isn't switching from "no warning" to "hard error" a bit strong?
Ralf