Reasonable static initialization assurance

John Love-Jensen eljay@adobe.com
Mon Sep 19 15:04:00 GMT 2005


Hi Corey,

> I knew there was no way around that -- but I thought there might be
> some way to do it, in some order.

As a general C/C++ solution, no.

There is a GCC mechanism that could help:
-finit-priority
__attribute__((init_priority(n)))

Depending on how dependent you like your code on compiler extensions.

>Do you know of any difference in this area with the OSX gcc?

I'm not aware if XCode 2.1 / GCC 4.0 on OS X has any particular caveats
other than the usual suspects applicable to all platforms.

HTH,
--Eljay



More information about the Gcc-help mailing list