Use for arithOperationsOnVoidPointer messages

This commit is contained in:
Daniel Marjamäki 2018-09-26 17:58:22 +02:00
parent e25bf187ad
commit b79d829cfc
1 changed files with 2 additions and 2 deletions

View File

@ -439,7 +439,7 @@ void CheckSizeof::sizeofDereferencedVoidPointerError(const Token *tok, const std
void CheckSizeof::arithOperationsOnVoidPointerError(const Token* tok, const std::string &varname, const std::string &vartype)
{
const std::string message = "'" + varname + "' is of type '" + vartype + "'. When using void pointers in calculations, the behaviour is undefined.";
const std::string message = "'$symbol' is of type '" + vartype + "'. When using void pointers in calculations, the behaviour is undefined.";
const std::string verbose = message + " Arithmetic operations on 'void *' is a GNU C extension, which defines the 'sizeof(void)' to be 1.";
reportError(tok, Severity::portability, "arithOperationsOnVoidPointer", message + "\n" + verbose, CWE467, false);
reportError(tok, Severity::portability, "arithOperationsOnVoidPointer", "$symbol:" + varname + '\n' + message + '\n' + verbose, CWE467, false);
}