From 35528ca708352fbe0023c0b31f0c5528f96d3288 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Thu, 22 May 2014 08:57:45 +0200 Subject: [PATCH] Added verbose message for "C-style pointer casting" (#4140) --- lib/checkother.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index f5325bfa9..474f420e7 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -511,7 +511,12 @@ void CheckOther::warningOldStylePointerCast() 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."); } //---------------------------------------------------------------------------