Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/17/84; site hpda.UUCP Path: utzoo!utcs!lsuc!pesnta!hplabs!hpda!decot From: decot@hpda.UUCP (Dave Decot) Newsgroups: net.lang.c Subject: Re: automatic aggregate initialization Message-ID: <507@hpda.UUCP> Date: Fri, 31-May-85 12:52:01 EDT Article-I.D.: hpda.507 Posted: Fri May 31 12:52:01 1985 Date-Received: Sat, 1-Jun-85 05:32:19 EDT Distribution: net Organization: Hewlett Packard Co. Cupertino, CA. Lines: 18 > its an implementation nightmare to have to init structures/arrays/unions > Remember automatic means that this stuff is on the stack, and your subroutine > will have to spend time doing the init (which should have just been static) > I agree it should be allowed but I won't use it. > > Hedley Rainnie. The language already allows you to declare automatic structures/arrays/unions. They do go on the stack. You probably use them whenever you call stat(2). To implement automatic initialization, pretend it's static, and generate the value somewhere at the beginning. Whenever the function or block is entered, just copy the block of memory into the stack where it's supposed to be. Simple. This is an easy way to do aggregate constants, too, but nobody seems to like that idea. Dave Decot / Hewlett-Packard Company / Data Systems Division decvax!ucbvax!hpda!decot