Simple questions about array declarations

Karl Heuer karl at haddock.ima.isc.com
Fri Mar 2 03:05:35 AEST 1990


In article <1990Feb28.221846.25750 at granite.cr.bull.com> blodgett at granite.cr.bull.com (Bruce Blodgett) writes:
>To determine the reason that the declaration
>	static int array7[];
>is not allowed, ask yourself, "if this is the only declaration of
>array7, how many elements should the array have?"  The answer, of
>course, is that you can't tell.  That is why this is not allowed.

So why doesn't the language wait to see if it *is* the only declaration before
rejecting it?  In other words, why isn't that a legal non-defining forward
declaration?  Note that "int foo[];" is legal, though it has the same problem.

Karl W. Z. Heuer (karl at ima.ima.isc.com or harvard!ima!karl), The Walking Lint



More information about the Comp.std.c mailing list