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]

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




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