...
Adding const
qualification may propagate through a program; as you add const
qualifiers, still more become necessary. This phenomenon is sometimes called " const poisoning." Const poisoning , which can frequently lead to violations of EXP05-C. Do not cast away a const qualification. While const
qualification is a good idea, the costs may outweigh the value in the remediation of existing code.
...
Noncompliant Code Example
In the following this noncompliant code, pi
is declared as a float
. Although pi is a mathematical constant, its value is not protected from accidental modification.
...