6.9 External definitions

Previous Table of Contents

1794

translation-unit:
                external-declaration
                translation-unit external-declaration

external-declaration: function-definition declaration

1795 The storage-class specifiers auto and register shall not appear in the declaration specifiers in an external declaration.

1796 There shall be no more than one external definition for each identifier declared with internal linkage in a translation unit.

1797 Moreover, if an identifier declared with internal linkage is used in an expression (other than as a part of the operand of a sizeof operator whose result is an integer constant), there shall be exactly one external definition for the identifier in the translation unit.

1798 As discussed in 5.1.1.1, the unit of program text after preprocessing is a translation unit, which consists of a sequence of external declarations.

1799 These are described as “external” because they appear outside any function (and hence have file scope).

1800 As discussed in 6.7, a declaration that also causes storage to be reserved for an object or a function named by the identifier is a definition.

1801 An external definition is an external declaration that is also a definition of a function (other than an inline definition) or an object.

1802 If an identifier declared with external linkage is used in an expression (other than as part of the operand of a sizeof operator whose result is an integer constant), somewhere in the entire program there shall be exactly one external definition for the identifier;

1803 otherwise, there shall be no more than one.137)

1804 137) Thus, if an identifier declared with external linkage is not used in an expression, there need be no external definition for it.

Next

Created at: 2005-06-29 02:19:03 The text from WG14/N1124 is copyright © ISO