Skip to content

Commit 44e8ee7

Browse files
authored
[flang][doc] refine zero initialization extension documentation (#121956)
Following-up on [comments ](#62432 (comment)) in the issue that motivated this extension.
1 parent 32bc029 commit 44e8ee7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flang/docs/Extensions.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,11 @@ end
160160
* `<>` as synonym for `.NE.` and `/=`
161161
* `$` and `@` as legal characters in names
162162
* Initialization in type declaration statements using `/values/`
163-
* Saved variables without explicit or default initializers are zero initialized.
163+
* Saved variables without explicit or default initializers are zero initialized,
164+
except for scalar variables from the main program that are not explicitly
165+
initialized or marked with an explicit SAVE attribute (these variables may be
166+
placed on the stack by flang and not zero initialized). It is not advised to
167+
rely on this extension in new code.
164168
* In a saved entity of a type with a default initializer, components without default
165169
values are zero initialized.
166170
* Kind specification with `*`, e.g. `REAL*4`

0 commit comments

Comments
 (0)