c++historystatic-initializationstatic-order-fiasco

Why is Static Initialization Order Fiasco called this way?


Since Static Initialization concerns Zero-initialization and initialization with a constant expression, according the C++03 standard, I cannot see which fiasco could arise there.

So, SO, why such a name, instead of eg "[Dynamic] Initialization Order Fiasco" ?

Edit:

It is actually a rhetorical question, but I find my English too weak to self-answer. I also loosely use "static initialization" as a short-cut for "all initialization happening before main()". But as 'static' term is already overloaded, I wrote down this question :


Solution

  • "Static" here refers (somewhat ambiguously, and not entirely accurately) to variables with static storage duration, not the static initialisation of non-local variables.

    You're correct that the fiasco only occurs with dynamic initialisation of non-local variables.

    why such a name?

    As with any colloquial expression, people use it because other people use and understand it, even if it's not the best possible way of expressing the concept.