Versions Compared

Key

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

...

Code Block
bgColor#CCCCFF
langc
char ch = 't';
if ((ch == 'a') || (ch == 'b') || (ch == 'c')) {
  /* ... */
}

Exceptions

STR09-C-EX1: Consecutive values for characters like a~z can be assumed on platforms where ASCII or Unicode is used. This recommendation is primarily concerned with platform portability, for example, if code is migrated from ASCII systems to non-ASCII systems.

Risk Assessment

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

STR09-C

Low

Unlikely

Low

P3

L3

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V

Supported indirectly via MISRA C:2012 rule 10.1.
Axivion Bauhaus Suite

Include Page
Axivion Bauhaus Suite_V
Axivion Bauhaus Suite_V

CertC-STR09
LDRA tool suite
Include Page
LDRA_V
LDRA_V
329 SFully implemented
Parasoft C/C++test
Include Page
Parasoft_V
Parasoft_V
CERT_C-STR09-a
Expressions with type (plain) char and wchar_t shall not be used as operands to built-in operators other than  =,  ==, != and the unary & operator
PRQA QA-C

Include Page
PRQA QA-C_v
PRQA QA-C_v

2106

2107


RuleChecker

Include Page
RuleChecker_V
RuleChecker_V


Supported indirectly via MISRA C:2012 rule 10.1.
 

Related Guidelines

Bibliography

[Jones 2009]Section 5.2.1, "Character Sets"

...


...

Image Modified Image Modified Image Modified