Versions Compared

Key

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

...

Making invalid assumptions about the type of a bit-field or its layout can result in unexpected program flow.

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

INT12-C

Low

Unlikely

Medium

P2

L3

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
bitfield-typeFully checked
Axivion Bauhaus Suite

Include Page
Axivion Bauhaus Suite_V
Axivion Bauhaus Suite_V

CertC-INT12
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
LANG.TYPE.BFSIGNBit-field signedness not explicit
Compass/ROSE
 

 

 




ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.INT12

Fully implemented

Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C0634, C0635
Klocwork
Include Page
Klocwork_V
Klocwork_V
MISRA.BITFIELD.TYPE
LDRA tool suite
Include Page
LDRA_V
LDRA_V

73 S

Fully implemented

Parasoft C/C++test
9.5MISRA2008-9_6_2Fully implementedPRQA QA-C Include PagePRQA QA-C_vPRQA QA-C_v

0634 (I)

0635

Include Page
Parasoft_V
Parasoft_V

CERT_C-INT12-a

Bit fields shall only be defined to be of type unsigned int or signed int

PC-lint Plus

Include Page
PC-lint Plus_V
PC-lint Plus_V

846

Fully supported

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C: Rec. INT12-C


Checks for bit-field declared without appropriate type (rec. fully covered)

RuleChecker
Include Page
RuleChecker_V
RuleChecker_V
bitfield-typeFully checked
SonarQube C/C++ Plugin
Include Page
SonarQube C/C++ Plugin_V
SonarQube C/C++ Plugin_V
S814
Fully implemented

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

Bibliography

[ISO/IEC 9899:2011]Subclause 6.3.1.1, "Boolean, Characters, and Integers"

...


...

Image Modified Image Modified Image Modified