diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 94713a0f6..13586e8dc 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -61,7 +61,7 @@ void CheckOther::incrementBooleanError(const Token *tok) Severity::style, "incrementboolean", "The use of a variable of type bool with the ++ postfix operator is always true and deprecated by the C++ Standard.\n" - "The operand of a postfix increment operator may be of type bool but it is deprecated by C++ Standard (Annex D-1) and the operand is always set to true\n" + "The operand of a postfix increment operator may be of type bool but it is deprecated by C++ Standard (Annex D-1) and the operand is always set to true." ); } diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index 7de154108..698c9f55a 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -20,6 +20,7 @@ #include "path.h" #include "cppcheck.h" +#include #include #include @@ -48,6 +49,13 @@ ErrorLogger::ErrorMessage::ErrorMessage(const std::list &callStack void ErrorLogger::ErrorMessage::setmsg(const std::string &msg) { + // If a message ends to a '\n' and contains only a one '\n' + // it will cause the _verboseMessage to be empty which will show + // as an empty message to the user if --verbose is used. + // Even this doesn't cause problems with messages that have multiple + // lines, none of the the error messages should end into it. + assert(!(msg[msg.size()-1]=='\n')); + // The summary and verbose message are separated by a newline // If there is no newline then both the summary and verbose messages // are the given message