Le Ven 19 Août 2005 21:50, André Wöbbeking a écrit : > On Friday 19 August 2005 21:14, Pierre Habouzit wrote: > > Le Ven 19 Août 2005 20:40, Reinhold Kainhofer a écrit : > > > It seems that gcc 4.0 is no longer initializing all members of a > > > struct, while gcc 3.3.x obviously did something like that. > > > > Then it's a gcc bug. > > > > when you write : > > > > Type1 func(...) { > > Type foo; > > } > > > > AFAIK either Type is a class, and then it's () constructor is > > called, else if it's a struct, a default constructor is called, > > that does the same as in C : it allocates enough space to make the > > struct live in it, > > correct > > > and then sets all its bits to 0. > > since when? You've to initialize PODs (bool, int, pointer, ...) > yourself in C and C++. okay, you're correct, I just checked in my books. I do too many C those days, sorry for the noise. gcc 4 is *not* wrong, though it should have a warning for that ... -- ·O· Pierre Habouzit ··O madcoder@debian.org OOO http://www.madism.org
Attachment:
pgp3rw875jEub.pgp
Description: PGP signature