Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Settings: Removed the --enable=posix option. Ticket: #2949

  • Loading branch information...
commit 01b9c0707d6faac42915c3f9348c13943aa539e8 1 parent 3151123
@danmar authored
View
3  cli/cmdlineparser.cpp
@@ -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"
View
2  lib/checknonreentrantfunctions.cpp
@@ -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
View
4 lib/checkobsoletefunctions.cpp
@@ -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())
View
2  lib/settings.cpp
@@ -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")
{
View
3  lib/settings.h
@@ -300,6 +300,9 @@ class Settings
/** Is the 'configuration checking' wanted? */
bool checkConfiguration;
+
+ /** Posix checks */
+ bool posix;
};
/// @}
View
11 test/testcmdlineparser.cpp
@@ -62,7 +62,6 @@ class TestCmdlineParser : public TestFixture
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 @@ class TestCmdlineParser : public TestFixture
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;
View
4 test/testnonreentrantfunctions.cpp
@@ -38,15 +38,13 @@ class TestNonReentrantFunctions : public TestFixture
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..
View
3  test/testobsoletefunctions.cpp
@@ -50,7 +50,6 @@ class TestObsoleteFunctions : public TestFixture
TEST_CASE(testgets);
}
-
void check(const char code[])
{
// Clear the error buffer..
@@ -58,7 +57,7 @@ class TestObsoleteFunctions : public TestFixture
Settings settings;
settings.addEnabled("style");
- settings.addEnabled("posix");
+ settings.posix = true;
// Tokenize..
Tokenizer tokenizer(&settings, this);
Please sign in to comment.
Something went wrong with that request. Please try again.