Hello all!

Augmentics. schrieb:
static is also good for initialising recursively with zero/null,

because a static delaration without explicit initialisation means
recursively initialisation with zero/null.
That's good for initialisation of big objects, e. g. of type pthread_t.

I'd forgotten about that [if I ever knew it!] ... is that for file level statics only ... or for statics inside functions too?

"static" will store the variable in the RAM. And by C standard
the used RAM is set to zero in the start-up code. By this,
all statics get initialized with zero unless you explizitly
change the start-up code.

But I think it is a good idea to write the initialization
to the code even if it is unnecessary. The compiler should
eliminate this and only initialization with different values
should be done during start-up.


        Robert Dominicus-Schleutermann

--
Robert Dominicus-Schleutermann      Telefon : +49 36203 96314
Software+Systeme Erfurt GmbH        Telefon : +49 36203 96301
Fichtenweg 8                        Fax     : +49 36203 96333
D-99198 Erfurt-Kerspleben
eMail: mailto:robert.dominicus-schleuterm...@sse-erfurt.de

Reply via email to