Versions Compared

Key

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

Wiki Markup
The C+\+ Standard \[[ISO/IEC 14882-2003|AA. C++ References#ISO/IEC 14882-2003]\] Section 17.4.3.1.2, "Global names" says: "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."  Trying to use a name of this form may lead to that name conflicting with one used by the implementation, with unpredictable results that may, but may not, be detected at compile time.

Non-Compliant Code Example

In this example, an object is defined with a name that is reserved for the implementation.

Code Block
bgColor#FFCCCC
int _Page_Count;
// ...

Compliant Solution

To correct this error, use names not beginning with an underscore followed by an uppercase letter and not containing a double underscore.

Code Block
bgColor#ccccff
int PageCount;
// ...

Risk Assessment

Using a name reserved for the implementation may lead to unpredictable results.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

DCL30-C

1 (low)

1 (unlikely)

3 (low)

P3

L3

References

Wiki Markup
\[[ISO/IEC 14882-2003|AA. C++ References#ISO/IEC 14882-2003]\] Section 17.4.3.1.2, "Global names"

...