This is the mail archive of the
mailing list for the GCC project.
Re: Initialising an union
Aurel Balmosan <email@example.com> writes:
> As it is defined in ANSI-C a struct where only the first part is initialised
> is filled with zero's.
> This is defined in the ANSI-C Language Reference A.8.7:
> Contains the initializer-list less initializer then the structure component
> has the rest values will be set to zero. There must not be more initializer
> than values in a structure component.
Does it apply to local non-static variables? I'm pretty sure this is
true for variables in static storage, but how about local ones?
Unfortunately, I don't have access to the ANSI-C Standard :-(
Universidade Estadual de Campinas, SP, Brasil