...
Wiki Markup |
---|
Compiling at high warning levels in compliance with [MSC00-A. Compile cleanly at high warning levels] causes warnings to be issued when converting from {{unsigned char\[\]}} to {{char const char *}} when {{char}} is signed and from {{signed char\[\]}} to {{char const char *}} when char 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. |
Wiki Markup |
---|
If this C code were to compiled using a C+\+ compiler, conversions from {{unsigned char\[\]}} to {{char const char *}} and from {{signed char\[\]}} to {{char const char *}} would be be flagged as errors requiring casts. |
...
Search for vulnerabilities resulting from the violation of this rule on the CERT website.
References
Wiki Markup |
---|
\[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]\] Section 6.2.5, "Types" \[[MISRA 04|AA. C References#MISRA 04]\] Rule 6.1, "The plain char type shall be used only for the storage and use of character values." |