g++ global constructor bug?

Dylan Cuthbert dylan@q-games.com
Fri Jul 5 21:14:00 GMT 2002


I've noticed this too.

Using cygwin, the stdio and cout handles are set up a while after the user's
global constructors.  Is this behaviour changeable or is the order of global
construction totally random?

Accessing std::cout from some constructors will cause a segfault rather than
simply not working too.

Regards
--
---------------------------------
Q-Games, Dylan Cuthbert.
http://www.q-games.com

"Christopher Faylor" <cygwin@cygwin.com> wrote in message
news:20020705203014.GA18639@redhat.com...
> On Fri, Jul 05, 2002 at 04:09:15PM -0400, Douglas S. J. De Couto wrote:
> >the following program doesn't work right with cygwin, it seems the
> >global object sh constructor is not being called.
>
> If I had to guess I'd say that the constructor is kicked off before
> stdio is completely set up.
>
> cgf
>
> >--------------------
> >
> >#include <stdio.h>
> >
> >struct foobar {
> >  foobar(int i) { printf ("foobar(%d)\n", i); }
> >};
> >
> >foobar sh(1);
> >
> >int
> >main(int argc, char **argv) {
> >  foobar s(2);
> >}
> --
> Please do not send me personal email with cygwin questions.
> Use the resources at http://cygwin.com/ .
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list