Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!apollo!vasta From: vasta@apollo.hp.com (John Vasta) Newsgroups: comp.sys.apollo Subject: Re: Is this a bug in Apollo C++ Compiler System? Summary: Nope Message-ID: <1991Jun27.194742.20508@apollo.hp.com> Date: 27 Jun 91 19:47:42 GMT Sender: netnews@apollo.hp.com (USENET posting account) Organization: Hewlett-Packard Company, Apollo Division - Chelmsford, MA Lines: 37 Nntp-Posting-Host: firenze.ch.apollo.hp.com In article <1801@usage.csd.unsw.oz.au> ashley@spectrum.cs.unsw.oz.au (Ashley Aitken) writes: >C++ Compiler System Bug Report? >=============================== > >Overview: > >Not all constructors and destructors for global (and static) >objects (in separated source files) are called before the >start of the main program. Those called depend on the >order of linking of the object files. This is a true statement, and is not in conflict with the definition of the C++ language, as Desmond D'Souza in pointed out. Section 3.4 of "The Annotated C++ Reference Manual", by Stroustrup and Ellis, is pretty clear on this. Now, your example shows that a constructor/destructor execution is simply missing. I tried your example with both Domain/C++ V2.0.0 and V2.1.0, and cannot reproduce your results - all constructors and destructors executed correctly. I had sent you private mail on this subject; I received no response so I'm not sure if you got my mail. But your problem sounds suspiciously like what will happen if you start using the latest release of the Domain/C compiler (V6.8) with C++ before V2.1.0. The C compiler now compresses data sections by default, and that messes up the C++ "constructor linker". This is described in the C release notes along with a workaround - use "-W0,-ncompress" to get the old behavior. The C++ 2.1.0 release fixes the problem so that you can use the compressed data feature. -- John Vasta Hewlett-Packard Apollo Systems Division vasta@apollo.hp.com M.S. CHR-03-DW (508) 256-6600 x5978 300 Apollo Drive, Chelmsford, MA 01824 UUCP: {decwrl!decvax, mit-eddie, attunix}!apollo!vasta