Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!sri-spam!ames!cit-vax!oddhack!jon From: jon@oddhack.caltech.edu (Jon Leech) Newsgroups: comp.lang.c++ Subject: Re: Is this a bug? Message-ID: <3008@cit-vax.Caltech.Edu> Date: Thu, 11-Jun-87 15:16:19 EDT Article-I.D.: cit-vax.3008 Posted: Thu Jun 11 15:16:19 1987 Date-Received: Sat, 20-Jun-87 11:39:36 EDT References: <731@boulder.Colorado.EDU> Sender: news@cit-vax.Caltech.Edu Reply-To: jon@oddhack.Caltech.EDU (Jon Leech) Organization: Caltech Odd Hack Committee Lines: 23 Keywords: streams, bug, global constructors Summary: Expires: Sender: Followup-To: Distribution: In article <731@boulder.Colorado.EDU> sanders@boulder.Colorado.EDU (Bruce Sanders) writes: >... >If I comment out the two lines with "global" in them, everything works, >producing the following output: >... >Alternatively, if I remove the cerr and print statements (indicated in >the comment) from the constructor, it works correctly, producing >... >Is this a bug, or am I doing something illegal? The constructor for 'global' is probably being called before the constructor for 'cerr'. Since cerr is declared in a different file, it appears (see the reference manual 8.6.2) that you have no control over the order in which these contructors are called, and thus should not write code with this sort of dependency. -- Jon Leech (jon@csvax.caltech.edu || ...seismo!cit-vax!jon) Caltech Computer Science Graphics Group __@/ ``There is only one spacefaring nation today. And it's not the United States, comrade!''