From c2de1a8a52d21a37ee49ecf21be16abc9b3c0f09 Mon Sep 17 00:00:00 2001 From: Kimmo Varis Date: Mon, 31 Jan 2011 22:49:52 +0200 Subject: [PATCH] Convert "too many configurations" message to information message. The "too many configurations"-message is currently only printed to the log. So it won't be seen by users integrating Cppcheck using XML error file. It is also easily missed in the GUI as it only shows up in the checking log. Making it a information message it shows up with the other errors and tells user that file was not completely checked. Ticket #2527 (Make "too many configurations" message an error message) --- lib/cppcheck.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/cppcheck.cpp b/lib/cppcheck.cpp index 62719d6c6..db0a15105 100644 --- a/lib/cppcheck.cpp +++ b/lib/cppcheck.cpp @@ -151,13 +151,21 @@ unsigned int CppCheck::check() // was used. if (!_settings._force && checkCount > 11) { - if (_settings._errorsOnly == false) - { - const std::string fixedpath = Path::toNativeSeparators(fname); - _errorLogger.reportOut(std::string("Bailing out from checking ") + fixedpath + - ": Too many configurations. Recheck this file with --force if you want to check them all."); - } - + const std::string fixedpath = Path::toNativeSeparators(fname); + ErrorLogger::ErrorMessage::FileLocation location; + location.setfile(fixedpath); + std::list loclist; + loclist.push_back(location); + const std::string msg("Interrupted checking because of too many #ifdef configurations.\n" + "The checking of the file was interrupted because there were too many " + "#ifdef configurations. Checking of all #ifdef configurations can be forced " + "by --force command line option or from GUI preferences. However that may " + "increase the checking time."); + ErrorLogger::ErrorMessage errmsg(loclist, + Severity::information, + msg, + "toomanyconfigs"); + _errorLogger.reportErr(errmsg); break; }