Simple questions about array declarations
Bruce Blodgett
blodgett at granite.cr.bull.com
Wed Feb 28 03:38:52 AEST 1990
In article <12235 at smoke.BRL.MIL> gwyn at smoke.BRL.MIL (Doug Gwyn) replies:
>- static int array7[];
>- static int array7[3] = { 1,2,3 };
>- static int array8[3];
>- static int array8[3] = { 1,2,3 };
>- static int array9[3];
>- static int array9[] = { 1,2,3 };
>- static int array10[];
>- static int array10[] = { 1,2,3 };
>
>All these are okay.
According to X3.159-1989 (the C Standard) section 3.7.2, "If the
declaration of an identifier for an object is a tentative definition
and has internal linkage, the declared type shall not be an incomplete
type." The first declarations of array7 and array10 are tentative,
have internal linkage, and are incomplete. Therefore they are not
allowed.
Bruce Blodgett
More information about the Comp.std.c
mailing list