Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!mit-eddie!bu-cs!bzs From: bzs@bu-cs.BU.EDU (Barry Shein) Newsgroups: comp.lang.c Subject: Re: union initialization Message-ID: <7023@bu-cs.BU.EDU> Date: Tue, 28-Apr-87 12:10:30 EDT Article-I.D.: bu-cs.7023 Posted: Tue Apr 28 12:10:30 1987 Date-Received: Thu, 30-Apr-87 00:42:46 EDT References: <3290@burdvax.PRC.Unisys.COM> <1722@plus5.UUCP> <455@haddock.UUCP> <6483@mimsy.UUCP> Organization: Boston U. Comp. Sci. Lines: 38 In-reply-to: chris@mimsy.UUCP's message of 28 Apr 87 06:44:49 GMT Posting-Front-End: GNU Emacs 18.41.4 of Mon Mar 23 1987 on bu-cs (berkeley-unix) My relatively worthless 2c: union foo { int a; char *p; double foo; } u[] = { {0,,}, /* init the int */ {,NULL,}, /* init the char * {,,0} /* init the double */ }; Or, similarly: union foo goo[] = { {0,void,void}, /* init the int */ {void,NULL,void}, /* init the char * */ {void,void,0} /* init the double */ }; or very similarly: union foo goo[] = { {0,(void),(void)}, /* init the int */ {(void),NULL,(void)}, /* init the char * */ {(void),(void),0} /* init the double */ }; Seems all that is needed is a way to specify positional parameters, any of these would do and all have slightly different historical precedent (the first ",," not C, but macro assemblers.) I like the first for its brevity (tho it would be error prone) and the last two for their C-ish style. Anyhow, that and several hundred million $$ will pay off the nat'l debt. -Barry "voidoid" Shein, Boston University