Local statics

Martin von Loewis loewis at informatik.hu-berlin.de
Thu Mar 9 11:29:35 UTC 2000


> Or, did we already handle this in some other way?

This is issue G-4. There has been a long debate on that one, but so
far, no conclusion was reached. Summarizing the positions so far, it
seems that we have about an even split of people for and against
potentially blocking initialisation.

No matter which solution is taken, I think the ABI *must* say
something about initialisation of local statics, to support the
at-most-once semantics even in the single-threaded case:

Since statics may appear in inline functions, references to the
statics from many translation units may occur. These shall all refer
to the same object, which is guaranteed by the mangling. However, the
object shall be at most once initialized, which is currently not
guaranteed, at least as far as the draft goes.

Martin




More information about the cxx-abi-dev mailing list