diff --git a/lib/checksizeof.cpp b/lib/checksizeof.cpp index a90f8ffc8..6f8515a5b 100644 --- a/lib/checksizeof.cpp +++ b/lib/checksizeof.cpp @@ -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); }