public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Reasonable static initialization assurance
@ 2005-09-17 17:29 corey taylor
       [not found] ` <200509190827.51191.ikrabbe.ask@web.de>
  2005-09-19 12:33 ` John Love-Jensen
  0 siblings, 2 replies; 8+ messages in thread
From: corey taylor @ 2005-09-17 17:29 UTC (permalink / raw)
  To: gcc-help

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2005-09-19 15:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-17 17:29 Reasonable static initialization assurance corey taylor
     [not found] ` <200509190827.51191.ikrabbe.ask@web.de>
2005-09-19  6:38   ` corey taylor
2005-09-19  7:33     ` Ingo Krabbe
2005-09-19 14:27       ` corey taylor
2005-09-19 12:33 ` John Love-Jensen
2005-09-19 14:27   ` corey taylor
2005-09-19 15:04     ` John Love-Jensen
2005-09-19 15:03       ` corey taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).