Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added table identifying linkages

...

Use of an identifier (within one translation unit) classified as both internally and externally linked causes undefined behavior. See also undefined behavior 8 in Appendix J of the C Standard. A translation unit includes the source file together with its headers and all source files included via the preprocessing directive #include.

The following table identifies the linkage assigned to an object that is declared twice in a single translation unit.

1st \ 2nd

static

/none/

extern

static

internal

undefined

internal

/none/

undefined

external

external

extern

undefined

external

external

Noncompliant Code Example

...