Main Content
Group 8: Constants
The custom rules 8.x
in Polyspace® enforce naming conventions for constants. For information on how to enable
these rules, see Check custom rules
(-custom-rules)
. These
rules do not apply to constants that are defined within a class or to constants that are
function parameters.
Number | Rule | Details |
---|---|---|
8.1 | All global nonstatic constant names must follow the specified pattern. | A global nonstatic constant is a constant with external linkage. |
8.2 | All global static constant names must follow the specified pattern. | A global static constant is a constant with internal linkage. |
8.3 | All local nonstatic constant names must follow the specified pattern. | A local nonstatic constant is a constant without linkage. |
8.4 | All local static constant names must follow the specified pattern. | A local static constant is a constant declared static in a function. |
8.5 | All floating constant values must follow the specified pattern. | Say you specify float f1 = 10.0F;//Compliant float f2 = 10.0f; //Noncompliant |