Standard for union initialization?
G|ran Uddeborg
uddeborg at chalmers.UUCP
Thu Jan 17 08:50:18 AEST 1985
In article <10884 at watmath.UUCP> kpmartin at watmath.UUCP (Kevin Martin) writes:
...
>union {
> <type1> foo;
> <type2> bar;
> <type3> mumble;
>}baz = mumble = <initializer>;
>Since <initializer> 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.
> Kevin Martin, UofW Software Development Group.
What about the ".=" operator discussed elsewhere in this group? :-)
--
"For me, UNIX is a way of being." (Originally: Armando P. Stettner)
G|ran Uddeborg
{seismo,philabs,decvax}!mcvax!enea!chalmers!uddeborg
More information about the Comp.lang.c
mailing list