...
Code Block | ||||
---|---|---|---|---|
| ||||
size_t len; char cstr[] = "char string"; signed char scstr[] = "signed char string"; unsigned char ucstr[] = "unsigned char string"; len = strlen(cstr); len = strlen(scstr); /* warnsWarns when char is unsigned */ len = strlen(ucstr); /* warnsWarns when char is signed */ |
Compiling at high warning levels in compliance with MSC00-C. Compile cleanly at high warning levels causes warnings to be issued when
- converting Converting from
unsigned char[]
toconst char *
whenchar
is signed. - converting Converting from
signed char[]
toconst char *
whenchar
is defined to be unsigned.
Casts are required to eliminate these warnings, but excessive casts can make code difficult to read and hide legitimate warning messages.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
|
|
| |||||||
ECLAIR |
| CC2.STR04 | Fully implemented | ||||||
|
|
| |||||||
5.0 |
| Can detect violations of this rule with CERT C Rule Pack, except cases involving | |||||||
PRQA QA-C |
| 0432 (C) | Partially implemented |
...