Created on 2024-06-20.00:00:00 last changed 1 month ago
Suggested resolution:
Change in 6.9.3.2 [basic.start.static] paragraph 1 as follows:
Variables with static storage duration are initialized as a consequence of program initiation. Variables with thread storage duration are initialized as a consequence of thread execution. If the program does not start a thread (6.9.2 [intro.multithread]) other than the main thread (6.9.3.1 [basic.start.main]) before the completion of all non-deferred (6.9.3.3 [basic.start.dynamic]) initialization of non-block variables with static storage duration, then all non-deferred initialization (if any) of non-block variables with static storage duration strongly happens before any non-deferred initialization of non-block variables with thread storage duration. Within each of these phases of initiation, initialization occurs as follows.
Change in 6.9.3.3 [basic.start.dynamic] paragraph 5 as follows:
It is implementation-defined whether the dynamic initialization of a non-block non-inline variable o with static storage duration is sequenced before the first statement of main or is deferred. If it is deferred, it strongly happens before any non-initialization odr-use of any non-inline function or non-inline variable defined in the same translation unit asthe variable to be initializedo and any deferred initialiation of non-inline non-block variables with thread storage duration defined in the same translation unit as o. [ Footnote: ... ] It is implementation-defined in which threads and at which points in the program such deferred dynamic initialization occurs.
(From submission #559.)
Specification is missing that clarifies that non-local variables with static storage duration are initialized before those with thread storage duration.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-08-20 21:00:58 | admin | set | status: open -> review |
2024-07-28 08:59:27 | admin | set | messages: + msg7772 |
2024-06-20 00:00:00 | admin | create |