cagney@chook.ua.oz (Andrew Cagney - aka Noid) (02/09/90)
Is the following valid ANSI C (when declaring 'global' objects)?
int i[]; vs extern int i[];
int i[] = {1,2,3,4,5}; int i[] = {1,2,3,4,5};
The real question is: is
int i[];
a `tentative definition' given that it fails to specify the size of the
object it is defining?
So either
1. int i[]; is not a vaild definition so treat it as a declaration.
2. int i[]; is missing the `extern' directive so it is a `tentative
definition' *but* it fails to specify the object size and hence
is in error.
Confused, Andrew Cagney.
BTW: GCC and unix compilers use choice 1, TCC follows choice two.
see fs/table.c for an example of the code.