initialization of automatic structures/unions

Henry Spencer henry at zoo.toronto.edu
Sun Mar 3 10:36:44 AEST 1991


In article <1991Mar2.000247.11318 at sctc.com> stachour at sctc.com (Paul Stachour) writes:
>>Can someone give me a good reason why initializing automatic
>>structures/unions is illegal?
>
>    Because according to the rules of initialization:
>Initializers follow the sames rules for type and conversion as do
>assignment statements, and one can't assign "constant structures"
>or "constant arrays" in C.

Oh really?  Initialization of static structs has been possible since the
dawn of time in C, which makes your statement complete nonsense.  Please
get your facts straight before you post.  You don't help the credibility
of your Ada-good-C-bad claims by such gross errors.

The issue at hand is why Mr. Vistima can do this for statics but not for
automatics; the answer is "because his compiler doesn't implement ANSI C".
-- 
"But this *is* the simplified version   | Henry Spencer @ U of Toronto Zoology
for the general public."     -S. Harris |  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.lang.c mailing list