introducing designated initializers for structures

Frank frannk_m1 at yahoo.com
Fri Dec 11 03:38:23 UTC 2009


It depends. If you initialize any member the linker will put the structure in the data segment with the other members having unknown values. if you don't initialize any of them the linker will put the structure in the .bss segment and the start up code will set _all_ members of the structure to zero.

--- On Sat, 5/20/06, Robert P. J. Day <rpjday at mindspring.com> wrote:

> From: Robert P. J. Day <rpjday at mindspring.com>
> Subject: introducing designated initializers for structures
> To: "BusyBox mailing list" <busybox at busybox.net>
> Date: Saturday, May 20, 2006, 4:29 AM
> 
>   attached is an example of a change i'd like to start
> making, just so
> it's more obvious what's being initialized in a structure.
> 
>   i forget the initialization rule, though -- what
> happens with
> members of statically-allocated structures in terms of
> their initial
> values?  will they be NULL or 0?  or should every
> member field be
> explicitly initialized?
> 
> rday
> 
> -----Inline Attachment Follows-----
> 
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox


      


More information about the busybox mailing list