Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!snorkelwacker.mit.edu!shelby!agate!dog.ee.lbl.gov!elf.ee.lbl.gov!torek From: torek@elf.ee.lbl.gov (Chris Torek) Newsgroups: comp.lang.c Subject: Re: initialization of automatic structures/unions Message-ID: <10493@dog.ee.lbl.gov> Date: 1 Mar 91 23:57:56 GMT References: <13599@life.ai.mit.edu> Reply-To: torek@elf.ee.lbl.gov (Chris Torek) Organization: Lawrence Berkeley Laboratory, Berkeley Lines: 16 X-Local-Date: Fri, 1 Mar 91 15:57:56 PST In article <13599@life.ai.mit.edu> filisa@albert.ai.mit.edu (Filisa Vistima) writes: >Can someone give me a good reason why initializing automatic >structures/unions is illegal? (says my compiler) It is illegal because your compiler is (choose one): (a) broken; (b) not ANSI C conformant. X3.159-1989 allows initialization of automatic (`local') structure and union variables, with the same syntax and semantics as for static variables (with the obvious change that the values do not persist). -- In-Real-Life: Chris Torek, Lawrence Berkeley Lab EE div (+1 415 486 5427) Berkeley, CA Domain: torek@ee.lbl.gov