From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Mitchell To: Andreas Schwab Cc: law@cygnus.com, egcs@cygnus.com Subject: Re: libio bugs Date: Mon, 02 Feb 1998 11:43:00 -0000 Message-id: <199802020725.HAA28844@quickstep.stanford.edu> References: <26550.886365977@hurl.cygnus.com> <199802012255.WAA28117@quickstep.stanford.edu> X-SW-Source: 1998-02/msg00085.html Andreas> |> Since the order of initializers isn't supposed to Andreas> matter, there is |> definitely a bug here if this fix Andreas> makes a difference. Does anyone |> have a simple Andreas> test-case for this bug? Andreas> G++ simply ignores all initializer labels. I have Andreas> already send a bug report, here it is again: Ah, I see. But initializer labels are a g++ extension. Perhaps it would be simpler simply to issue an error message on any use of initializer labels? Is the point of this to allow out-of-order initialization of the members? Why is there code in libio that uses this extension? Is there other C++ code that uses this extension? Andreas> $ cat init.cc struct X { int a, b; }; Andreas> struct X f (int a, int b) { struct X y = { b: b, a: a }; Andreas> // labels ignored by g++ return y; } Andreas> int main () { struct X x = f (42, 0); if (x.a != 42 || Andreas> x.b != 0) abort (); exit (0); } $ gcc init.cc $ ./a.out Andreas> Aborted (core dumped) Andreas> -- Andreas Schwab "And now for something Andreas> schwab@issan.informatik.uni-dortmund.de completely Andreas> different" schwab@gnu.org -- Mark Mitchell mmitchell@usa.net Stanford University http://www.stanford.edu