C says that:
(C11, 6.7.9p23) "The evaluations of the initialization list expressions are indeterminately sequenced with respect to one another and thus the order in which any side effects occur is unspecified."
and in C99
(C99, 6.7.8p23) "The order in which any side effects occur among the initialization list expressions is unspecified."
That means that the declaration
bool condition[10] = {true,condition[5]=true};
can have the same behavior:
bool condition[10] = {true, 1};
or as
bool condition[10] = {true, 1, [5] = true};
whether condition[5] = true
evaluation is done before or after the 0
initialization of the array members.
EDIT: there is a case of unspecified initialization order of array elements in Defect Report #208. The case is different because in the DR example there are two initializers for a single element.
http://www.open-std.org/jtc1/sc22/wg14/www/docs/9899tc1/n32074.htm
int a [2] = { f (0), f (1), [0] = f (2) };
It was the intention of WG14 that the call f(0) might, but need not, be made when a is initialized. If the call is made, the order in which f(0) and f(2) occur is unspecified (as is the order in which f(1) occurs relative to both of these). Whether or not the call is made, the result of f(2) is used to initialize a[0].
condition[5]
also is available at this timing. – BLUEPIXY yesterdaycondition[5]=true
is an assignment. It assigns the valuetrue
tocondition[5]
. It also yields the valuetrue
, which is used to initializecondition[1]
. – Keith Thompson yesterday