[En-Nut-Discussion] ZERO_INIT off topic, was:Problem with Ethernut Startup

Mgr. Pavel Chromy chromy at asix.cz
Wed Jun 25 08:57:42 CEST 2003


Tuesday, June 24, 2003, 10:40:01 PM Harald wrote:

>>Back on my protability horse.
>>Even better is
>>static int bar ZERO_INIT;

> Aesthetic hat on.
> Waaahhh, this looks sooouu ugly. :-)

Agree, that is really ugly.
a bit better would be

#define ZERO_INIT(x) x=0
static int ZERO_INIT bar;

> Seriously, I doubt there is _any_ C environment, where statics/globals
> are _not_ initialized to zero.

FYI HI-TECH PICC - at least bitfield structure members are not
initialized to zero, but this is really a rare case.

Mgr. Pavel Chromy
ASIX s.r.o.
Staropramenna 4
150 00 Praha 5




More information about the En-Nut-Discussion mailing list