Settings: Removed the --enable=posix option. Ticket: #2949
This commit is contained in:
parent
315112314c
commit
01b9c0707d
|
@ -660,9 +660,6 @@ void CmdLineParser::PrintHelp()
|
|||
" * missingInclude\n"
|
||||
" Warn if there are missing includes.\n"
|
||||
" For detailed information use --check-config\n"
|
||||
" * posix\n"
|
||||
" Enable checks specific for POSIX-compiliant\n"
|
||||
" code.\n"
|
||||
" Several ids can be given if you separate them with\n"
|
||||
" commas.\n"
|
||||
" --error-exitcode=<n> If errors are found, integer [n] is returned instead\n"
|
||||
|
|
|
@ -33,7 +33,7 @@ CheckNonReentrantFunctions instance;
|
|||
|
||||
void CheckNonReentrantFunctions::nonReentrantFunctions()
|
||||
{
|
||||
if (!_settings->isEnabled("posix") || !_settings->isEnabled("style"))
|
||||
if (!_settings->posix || !_settings->isEnabled("style"))
|
||||
return;
|
||||
|
||||
// Don't check C# and Java code
|
||||
|
|
|
@ -40,8 +40,6 @@ void CheckObsoleteFunctions::obsoleteFunctions()
|
|||
if (_tokenizer->isJavaOrCSharp())
|
||||
return;
|
||||
|
||||
const bool checkPosix = _settings->isEnabled("posix");
|
||||
|
||||
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
|
||||
{
|
||||
if (tok->isName() && tok->varId()==0 && tok->strAt(1) == "(" && !Token::Match(tok->previous(), ".|::|:|,"))
|
||||
|
@ -58,7 +56,7 @@ void CheckObsoleteFunctions::obsoleteFunctions()
|
|||
reportError(tok->tokAt(1), Severity::information, "obsoleteFunctions"+it->first, it->second);
|
||||
break;
|
||||
}
|
||||
else if (checkPosix)
|
||||
else if (_settings->posix)
|
||||
{
|
||||
it = _obsoletePosixFunctions.find(tok->str());
|
||||
if (it != _obsoletePosixFunctions.end())
|
||||
|
|
|
@ -48,6 +48,7 @@ Settings::Settings()
|
|||
reportProgress = false;
|
||||
ifcfg = false;
|
||||
checkConfiguration = false;
|
||||
posix = false;
|
||||
}
|
||||
|
||||
std::string Settings::Suppressions::parseFile(std::istream &istr)
|
||||
|
@ -393,7 +394,6 @@ std::string Settings::addEnabled(const std::string &str)
|
|||
id.insert("missingInclude");
|
||||
id.insert("unusedFunction");
|
||||
id.insert("information");
|
||||
id.insert("posix");
|
||||
|
||||
if (str == "all")
|
||||
{
|
||||
|
|
|
@ -300,6 +300,9 @@ public:
|
|||
|
||||
/** Is the 'configuration checking' wanted? */
|
||||
bool checkConfiguration;
|
||||
|
||||
/** Posix checks */
|
||||
bool posix;
|
||||
};
|
||||
|
||||
/// @}
|
||||
|
|
|
@ -62,7 +62,6 @@ private:
|
|||
TEST_CASE(enabledStyle);
|
||||
TEST_CASE(enabledUnusedFunction);
|
||||
TEST_CASE(enabledMissingInclude);
|
||||
TEST_CASE(enablePosix);
|
||||
TEST_CASE(errorExitcode);
|
||||
TEST_CASE(errorExitcodeMissing);
|
||||
TEST_CASE(errorExitcodeStr);
|
||||
|
@ -425,16 +424,6 @@ private:
|
|||
ASSERT(settings.isEnabled("missingInclude"));
|
||||
}
|
||||
|
||||
void enablePosix()
|
||||
{
|
||||
REDIRECT;
|
||||
const char *argv[] = {"cppcheck", "--enable=posix", "file.cpp"};
|
||||
Settings settings;
|
||||
CmdLineParser parser(&settings);
|
||||
ASSERT(parser.ParseFromArgs(3, argv));
|
||||
ASSERT(settings.isEnabled("posix"));
|
||||
}
|
||||
|
||||
void errorExitcode()
|
||||
{
|
||||
REDIRECT;
|
||||
|
|
|
@ -38,15 +38,13 @@ private:
|
|||
TEST_CASE(test_crypt);
|
||||
}
|
||||
|
||||
|
||||
void check(const char code[])
|
||||
{
|
||||
// Clear the error buffer..
|
||||
errout.str("");
|
||||
|
||||
Settings settings;
|
||||
settings.addEnabled("posix");
|
||||
settings.inconclusive = true;
|
||||
settings.posix = true;
|
||||
settings.addEnabled("style");
|
||||
|
||||
// Tokenize..
|
||||
|
|
|
@ -50,7 +50,6 @@ private:
|
|||
TEST_CASE(testgets);
|
||||
}
|
||||
|
||||
|
||||
void check(const char code[])
|
||||
{
|
||||
// Clear the error buffer..
|
||||
|
@ -58,7 +57,7 @@ private:
|
|||
|
||||
Settings settings;
|
||||
settings.addEnabled("style");
|
||||
settings.addEnabled("posix");
|
||||
settings.posix = true;
|
||||
|
||||
// Tokenize..
|
||||
Tokenizer tokenizer(&settings, this);
|
||||
|
|
Loading…
Reference in New Issue