Added verbose message for "C-style pointer casting" (#4140)

This commit is contained in:
PKEuS 2014-05-22 08:57:45 +02:00
parent cccddc20bf
commit 35528ca708
1 changed files with 6 additions and 1 deletions

View File

@ -511,7 +511,12 @@ void CheckOther::warningOldStylePointerCast()
void CheckOther::cstyleCastError(const Token *tok) void CheckOther::cstyleCastError(const Token *tok)
{ {
reportError(tok, Severity::style, "cstyleCast", "C-style pointer casting"); reportError(tok, Severity::style, "cstyleCast",
"C-style pointer casting\n"
"C-style pointer casting detected. C++ offers four different kinds of casts as replacements: "
"static_cast, const_cast, dynamic_cast and reinterpret_cast. A C-style cast could evaluate to "
"each of those automatically, thus it is considered safer it the programmer explicitly states "
"which kind of cast is expected.");
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------