Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Section Subclause 6.5.2.5 of the C Standard [ISO/IEC 9899:2011] defines a compound literal as

...

following initialization, the int pointer ip contains the address of an unnamed object of type int[4], allocated on the stack. Once func returns, any attempts to access this object will produce undefined behavior.

Note that only one object is created per compound literal—even if the compound literal appears in a loop and has dynamic initializers.

...

Bibliography

[ISO/IEC 9899:2011]Section Subclause 6.5.2.5, "Compound Literals"

...