Annex F (informative)
Core undefined behavior
[ub]
F.4
[stmt]
: Statements
[ub.stmt]
F.4.3
[ub:stmt.dcl.local.static.init.recursive]
Specified in:
[stmt.
dcl]
1
#
If control re-enters the declaration recursively while the variable is being initialized, the behavior is undefined
.
2
#
[
Example
1
:
int
foo
(
int
i
)
{
static
int
s
=
foo
(
2
*
i
)
;
// undefined behavior, recursive call
return
i
+
1
;
}
—
end example
]