www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/30/21:14:52

Date: Tue, 30 Apr 1996 21:01:55 -0400
From: dj (DJ Delorie)
Message-Id: <199605010101.VAA02599@delorie.com>
To: elric AT wheel DOT ucdavis DOT edu
CC: djgpp AT delorie DOT com
In-reply-to: <4m3n3v$dc7@mark.ucdavis.edu> (elric@wheel.ucdavis.edu)
Subject: Re: How safe is this?

> One problem you can have is if you use anything that needs to be 
> initialized too.  Examples are the predefined stream (cin, cout, cerr) or 
> files (stdin, stdout, stderr), and parts of the run-time library.  The 
> order can and will vary without much rhyme or reason.

stdin, stdout, stderr, stdprn, and stdaux are all pre-initialized by
the compiler.  They will be available when static objects are
constructed.

All other libc startup is done before static constructors as well.
The only consideration is the sequence of static construction (yours
vs cout, for example).  Note that the conio functions are initialized
this way, so they may not be available until main().

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019