This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: order of constructors
- From: Joe Buck <jbuck at synopsys dot com>
- To: Jim Wilson <wilson at specifixinc dot com>
- Cc: Peter Barada <peter at the-baradas dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 2 Dec 2003 17:08:47 -0800
- Subject: Re: order of constructors
- References: <20031202021026.4C41E98C92@baradas.org> <3FCD289A.8050209@specifixinc.com>
On Tue, Dec 02, 2003 at 04:04:42PM -0800, Jim Wilson wrote:
> Peter Barada wrote:
> > Is there any way to control the order of static constructors so that
> > some that access other functions are done after those functions
> > intializing fucntions are done?
>
> The C++ front end supports an init_priority attribute. This is
> documented in the manual.
If you require portable C++ code, arranging that the static constructors
that have an order dependency are in the same file will enforce an ordering.