Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The sentence highlighted below in [basic.start.static]/2 is indexed to {initialization!runtime}. Is that correct? #2844

Closed
jabelloc opened this issue Apr 25, 2019 · 1 comment · Fixed by #2867
Assignees

Comments

@jabelloc
Copy link

jabelloc commented Apr 25, 2019

[basic.start.static]/2

Constant initialization is performed if a variable or temporary object with static or thread storage duration is initialized by a constant initializer ([expr.const]) for the entity. If constant initialization is not performed, a variable with static storage duration ([basic.stc.static]) or thread storage duration ([basic.stc.thread]) is zero-initialized ([dcl.init]). Together, zero-initialization and constant initialization are called static initialization; all other initialization is dynamic initialization. All static initialization strongly happens before ([intro.races]) any dynamic initialization. [ Note: The dynamic initialization of non-local variables is described in [basic.start.dynamic]; that of local static variables is described in [stmt.dcl]. — end note ]

To verify this, see line # 5735 in the committed pull request:

5735 \indextext{initialization!runtime}%

AFAICT this is basically saying that zero-initialization is somehow related to run-time initialization, which doesn't seem to be correct.

To correct this, simply reverse the content of lines 6067 and 6068 in basic.tex.

@jensmaurer
Copy link
Member

Both constant and zero-initialization can happen at runtime, as long as they happen before "main". So "runtime" is not exactly wrong here, but probably not really appropriate. I've replaced it with "zero-initialization", which already had an entry in the index.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants