Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP Path: utzoo!watmath!watdaisy!ndiamond From: ndiamond@watdaisy.UUCP (Norman Diamond) Newsgroups: net.lang.c Subject: Re: Standard for union initialization? Message-ID: <6856@watdaisy.UUCP> Date: Mon, 14-Jan-85 12:02:11 EST Article-I.D.: watdaisy.6856 Posted: Mon Jan 14 12:02:11 1985 Date-Received: Tue, 15-Jan-85 01:35:27 EST References: <6995@brl-tgr.ARPA> <7004@brl-tgr.ARPA> <6847@watdaisy.UUCP> <10884@watmath.UUCP> Organization: U of Waterloo, Ontario Lines: 28 Kevin Martin proposes an initializer of the form: > element = value > e.g. > union { >foo; > bar; > mumble; > }baz = mumble = ; > Since can be an expression in C already, you might find that > your compiler's grammar already allows this, and it is only detected as > an error after further analysis. > > Of course, if the "element =" is absent, the first element could be > initialized. Similarly for the implicit zeroing of un-initialized > static storage. What is the datatype of "mumble"? Assigning mumble = or mumble = should cause an error, unless is an int or near-relative of an int. And then, how can mumble be used as the initializer for baz? -- Norman Diamond UUCP: {decvax|utzoo|ihnp4|allegra|clyde}!watmath!watdaisy!ndiamond CSNET: ndiamond%watdaisy@waterloo.csnet ARPA: ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa "Opinions are those of the keyboard, and do not reflect on me or higher-ups."