[GRASS-dev] Re: is `initialized' initialized in HTML_Driver ()?

Glynn Clements glynn at gclements.plus.com
Mon Oct 13 02:15:08 EDT 2008


Ivan Shmakov wrote:

>  >> Doesn't C require an explicit initial value for `initialized' here?
> 
>  > Well, as it is a static variable it will be initialised to zero.
> 
> 	Oh, never knew C has such a feature.  (Still, it may make sense
> 	to add an explicit initializer for the sake of clarity.)

If you add an explicit initialiser, the variable will be placed in the
data segment.

Variables which are implicitly initialised to "zero" (i.e. any global
variables and "static" local variables lacking an explicit
initialiser) are placed in the BSS segment. As the entire BSS segment
is zero, its contents don't need to be stored in the resulting binary
file.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list