Versions Compared

Key

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

...

Integer promotions require the promotion of each variable (c1 and c2) to int size. The two int values are added, and the sum is truncated to fit into the char type. Integer promotions are performed to avoid arithmetic errors resulting from the overflow of intermediate values:

...

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

INT02-C

mediumMedium

probableProbable

mediumMedium

P8

L2

Automated Detection

Tool

Version

Checker

Description

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.INT02

Fully implemented

LDRA tool suite

Include Page
LDRA_V
LDRA_V

52 S
93 S
96 S
101 S
332 S
334 S
433 S
434 S
442 S
443 S
446 S
452 S
457 S
458 S
491 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V

0290
0291
3755
3756
3757
3758
3759
3760
3762
3763
3764
3765

Fully implemented

...

[Dowd 2006]Chapter 6, "C Language Issues" ("Type Conversions," pp. 223–270)[ISO/IEC 9899:2011]Subclause 6.3.1.1, "Boolean, Characters, and Integers"
Subclause 6.3.1.3, "Signed and Unsigned Integers"
[Seacord 2013]

Chapter 5, "Integer Security"

...