C17 is only a “bugfix” release of the C standard, with one exception, the changes concerning
ATOMIC_VAR_INIT are a normative.
ATOMIC_VAR_INIT had to be used as an initializer for an atomic object. Several defect reports remarked that the working of this was not clear at all.
- The default initialization of atomic objects, such as static variables was not clear.
ATOMIC_VAR_INITwas specified to receive a value as its argument. But not for
structthere are no constant values that could be uniformly used in file scope.
When discussing these problems, the committee noted that all known implementations of C11 atomics did not need the macro for an initialization. Standard initializers just as for any other data type could be used. It was thus decided to remove the obligation to use the macro for an initialization. Section 7.17.2 p2, second sentence now reads:
An atomic object with automatic storage duration that is not explicitly initialized using ATOMIC_VAR_INIT is initially in an indeterminate state; however, the default (zero) initialization for objects with static or thread-local storage duration is guaranteed to produce a valid state.
By that small change atomic variables are not treated any different from other variables anymore. If they are explicitly or implicitly initialized they have a well defined state. Also since now atomic variables are like anybody else, the initial value in case of default initialization is
Because now the macro is basically useless, a note was added to 7.31.8, future library directions for
ATOMIC_VAR_INITis an obsolescent feature.