Reasonable static initialization assurance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there any reasonable manner to ensure a static object is
initialized before use without wrapping it in a getter/setter
function?

We are seeing some order issues show up on an OSX build (not linux though yet).

Take file.a and file.b:

file.a has a global variable of a table which accesses the static
System class methods for allocation and setup.

file.b has the System methods which all call an init method when first
called to make sure the system is setup right and find out what
version and computer is running.  This method accesses a static global
variable in file.b and seg faults.

Is there any way to ensure a static variable in file.b is initialized
before being used?

Corey


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux