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 <[email protected]> wrote:

> From: Robert P. J. Day <[email protected]>
> Subject: introducing designated initializers for structures
> To: "BusyBox mailing list" <[email protected]>
> 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
> [email protected]
> http://busybox.net/cgi-bin/mailman/listinfo/busybox


      
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to