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)
This commit is contained in:
Kimmo Varis 2011-01-31 22:49:52 +02:00
parent 8298c07d60
commit c2de1a8a52
1 changed files with 15 additions and 7 deletions

View File

@ -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<ErrorLogger::ErrorMessage::FileLocation> 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;
}