Path: utzoo!mnetor!uunet!husc6!ukma!ufcsv!gatech!mcnc!thorin!tyler!leech From: leech@tyler.cs.unc.edu (Jonathan Leech) Newsgroups: comp.lang.c++ Subject: Re: Ordering of initialisation of static classes in *different* files ? Message-ID: <782@thorin.cs.unc.edu> Date: 20 Jan 88 22:39:00 GMT References: <734@hslrswi.UUCP> <218@goofy.megatest.UUCP> <735@hslrswi.UUCP> Sender: news@thorin.cs.unc.edu Reply-To: leech@tyler.UUCP (Jonathan Leech) Organization: University Of North Carolina, Chapel Hill Lines: 22 Keywords: ordering of static initialisation Summary: Expires: Sender: Followup-To: Distribution: In article <735@hslrswi.UUCP> robert@hslrswi.UUCP (J. Robert Ward) writes: >>A little >>thought will convince you that it would be a non-trivial job to assure >>proper order of construction. >I agree that this is decidedly a "non-trivial job". If the ordering can be communicated to cfront, it can put keys into the per-file constructor & destructor tables (that is, into their symbol names). Then both the 'munch' and 'patch' approaches can sort the global table's contents by these keys. This would be tedious to code but not difficult. The hard part is then defining *what* the order of initialization should be, since dependencies are not so easily identified as with the IMPORT/EXPORT approach used in Modula-2 like languages. What is the ordering you propose? Jon Leech (leech@cs.unc.edu) __@/ ``After all, the best part of a holiday is perhaps not so much to be resting yourself as to see all the other fellows busy working.'' - Kenneth Grahame, _The Wind in the Willows_