Versions Compared

Key

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

If a constant value is given for an identifier, do not diminish the maintainability of the code in which it is used by assuming its value in expressions. Simply giving the constant a name is not enough to ensure modifiability; you must be careful to always use the name, and remember that the value can change. This recommendation is related to DCL06-C. Use meaningful symbolic constants to represent literal values.

Noncompliant Code Example

...

Tool

Version

Checker

Description

Section

LDRA tool suite

Include Page
LDRA_V
LDRA_V
Section

201 S

Section

Fully Implemented

PRQA QA·CQA-C
Include Page
PRQA_V
PRQA_V
 

Partially Implemented

 

...

ISO/IEC 9899:2011 Section 6.10, "Preprocessing directives," and Section 5.1.1, "Translation environment"

Bibliography

[Plum 1985] Rule 1-5

...