Versions Compared

Key

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

The three types char, signed char, and unsigned char are collectively called the character types. Compilers have the latitude to define char to have the same range, representation, and behavior as either signed char or unsigned char. Irrespective of the choice made, char is a separate type from the other two and is not compatible with either.

...

Code Block
bgColor#ccccff
#include <string.h>

int main(void) {
  size_t len;
  char cstr[] = "char string";

  len = strlen(cstr);
  return 0;
}

Conversions are not required and the code compiles cleanly at high warning levels without casts.

Risk Assessment

Recommendation

Severity

Likelihood

Remediation Cost

Priority

Level

STR07-A

1 (low)

1 (unlikely)

2 (medium)

P2

L3

...