From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199606041450.HAA13535@koala.azstarnet.com> Date: Tue, 4 Jun 1996 07:50:40 -0700 From: David Mosberger-Tang Subject: Re: gcc question >>>>> On Tue, 04 Jun 1996 08:22:26 -0400, "Michael K. Johnson" said: Michael> Linus Torvalds writes: >> On Mon, 3 Jun 1996, David Mosberger-Tang wrote: >>> Please note that it is _not possible_ to initialize unions in >>> ANSI C. >> Actually, it's possible (umm - raincheck on the standard here, >> I'm too lazy to look it up, but I'm fairly certain). The standard >> allows you to initialize unions, but only the _first_ entry in a >> union. Michael> Absolutely right. Cancel the raincheck, Linus. Michael> Just in case anyone wants standards support, see 6.5.7. It Michael> says "A brace-enclosed initializer for a union object Michael> initializes the member that appears first in the Michael> declaration list of the union type." Yes, you're both right. I have an old C book which claims otherwise, but checking a more recent one does indeed say that a union initializer initializes the first member. Sorry about the confusion. --david