You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The C++ Standard [[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.

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.

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)

1 (high)

P1

L3

References

  • No labels