Versions Compared

Key

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

...

When converting integers to floating-point values, and vice versa, it is important to carry out proper range checks to avoid undefined behavior . (See see FLP34-C. Ensure that floating-point conversions are within range of the new type).)

Noncompliant Code Example

...

Tool

Version

Checker

Description

Compass/ROSE

 

 

Can detect violations of this rule. Any assignment operation where the type of the assigned-to value is float or double, but all the expressions to the right of the assignment are integral, is a violation of this rule

LDRA tool suite

Include Page
LDRA_V
LDRA_V

435 S

Enhanced Enforcementenforcement

PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v

4117
4118

Partially implemented

Splint

Include Page
Splint_V
Splint_V

 

 

...