Path: utzoo!telly!ddsw1!lll-winken!killer!mit-eddie!bloom-beacon!apple!rutgers!tut.cis.ohio-state.edu!ORION.CF.UCI.EDU!schmidt%blanche.ics.uci.edu From: schmidt%blanche.ics.uci.edu@ORION.CF.UCI.EDU ("Douglas C. Schmidt") Newsgroups: gnu.g++.bug Subject: G++ ignores static destructors under strange conditions Message-ID: <8810102158.aa09824@PARIS.ICS.UCI.EDU> Date: 11 Oct 88 04:58:31 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 34 Hi, Here is a weird program, that prints hello world world when compiled and executed with AT&T CC 1.2.1. G++ 1.27 prints only hello This appears to be an error, but I'm not certain enough of the semantics of destructors to know for certain. Here's the code: ---------------------------------------- struct Main { public: Main ( void ) { printf ( "hello " ); exit(); } ~Main ( void ) { printf ( "world\n" ); } }; static struct Main Initialization_Code; main() { printf ( "my " ); } ----------------------------------------