Based on that document, section DR 454, using the macro makes it impossible to know in which state is the variable.
atomic_int guide1 = ATOMIC_VAR_INIT(42); /* known value(42); WHAT STATE? */
But using the normal assignment is also undetermined, as shown bellow.
atomic_int guide2; /* indeterminate value; indeterminate state */
atomic_int guide3 = 42; /* known value(42); indeterminate state */
To put your variable in a known state, you have either to use static
or the atomic_init
function.
static atomic_int guide4; /* known value(0); valid state */
static atomic_int guide5 = 42; /* known value(42); valid state */
atomic_int guide6;
atomic_init(&guide6, 42); /* known value(42); initialized state */
But that's the only information I could find.