On Mi, 2010-01-27 at 11:50 +0000, Lukas Zeller wrote: > On Jan 27, 2010, at 12:24 , Patrick Ohly wrote: > > >> Second - I don't really see why declaring it static would mean > >> anything for initialisation (apart from the fact that gcc seems not to > >> be able to figure out it should complain about it then) - C-ish stuff > >> is not implicitly initialized, neither in global scope nor on the > >> stack. > > > > In global scope it is filled with zero. Only on the stack is the content > > undefined. > > I know that most environments do that - but from a puristic C point of > view: is this really something C specification demands?
Kernigham/Ritchie say so. "Programming in C - ANSI C", A.8.7 Initialisierung: "Ein statisches Object, das nicht explizit initialisiert ist, wird so intitialisiert, als ob die Konstante 0 and das Objekt (oder seine Teile) zugewiesen wird.". Of course, that's just the spec. Reality always trumps the spec ;-) -- Best Regards, Patrick Ohly The content of this message is my personal opinion only and although I am an employee of Intel, the statements I make here in no way represent Intel's position on the issue, nor am I authorized to speak on behalf of Intel on this matter. _______________________________________________ os-libsynthesis mailing list os-libsynthesis@synthesis.ch http://lists.synthesis.ch/mailman/listinfo/os-libsynthesis