Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updated with C++ reserved names.

Wiki Markup
According toThe the C+\+ Standard \[[ISO/IEC 14882-2003|AA. References#ISO/IEC 14882-2003]\], Section 17.4.3.1.2 specifies the following sets of reserved names:

  • Each name that contains a double underscore __ or begins with an underscore followed by an uppercase letter is reserved to the implementation for any use.
  • Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.
  • Each name declared as an object with external linkage in a header is reserved to the implementation to designate that library object with external linkage, both in namespace std and in the global namespace.
  • Each global function signature declared with external linkage in a header is reserved to the implementation to designate that function signature with external linkage.
  • Each name from the Standard C library declared with external linkage is reserved to the implementation for use as a name with extern "C" linkage, both in namespace std and in the global namespace.
  • Each function signature from the Standard C library declared with external linkage is reserved to the implementation for use as a function signature with both extern "C" and extern "C++" linkage, or as a name of namespace scope in the global namespace.
  • For each type T from the Standard C library, the types ::T and std::T are reserved to the implementation and, when defined, ::T shall be identical to std::T.
  • A translation unit that includes a standard library header shall not #define or #undef names declared in any standard library header.

Wiki Markup
In addition, the C99 Standard \[[ISO/IEC 9899:1999|AA. References#ISO/IEC 9899-1999]\], largely subsumed by C\+\+, specifies in section 7.1.3 the following sets of reserved names:

  • All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.
  • All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces.
  • Each macro name in any of the subclauses (including the future library directions) is reserved for use as specified if any of its associated headers is included, unless explicitly stated otherwise.
  • All identifiers with external linkage(including future library directions) are always reserved for use as identifiers with external linkage.
  • Each identifier with file scope listed in any of the above subclauses (including the future library directions) is reserved for use as a macro name and as an identifier with file scope in the same name space if any of its associated headers is included.

No other identifiers are reserved #1. The behavior of a program that declares or defines an identifier in a context in which it is reserved or defines a reserved identifier as a macro name, is undefined . Trying to define a reserved identifier can result in its name conflicting with that used in implementation, which may or may not be detected at compile time.

Wiki Markup
<ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="a569c03d51b30118-183d5274-434b45d5-80c9bfc9-44e11892359fd5e7fc0df7d9"><ac:parameter ac:name="">1</ac:parameter></ac:structured-macro> \[1\] Note that the POSIX ^&#xAE;^ standard extends the set of identifiers reserved by C99 to include an open-ended set of its own. See section [2.2 Compilation Environment|http://www.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02] in [\[IEEE Std 1003.1-2008\]|AA. References#IEEE Std 1003.1-2008].

...