Skip to content

Commit 7ac5f14

Browse files
committed
fixed unmatchedSuppression selfcheck warnings
1 parent 15285da commit 7ac5f14

17 files changed

+8
-36
lines changed

.selfcheck_suppressions

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ missingIncludeSystem
22

33
# temporary suppressions - fix the warnings!
44
simplifyUsing:lib/valueptr.h
5-
varid0:gui/projectfile.cpp
65
naming-privateMemberVariable:gui/test/cppchecklibrarydata/testcppchecklibrarydata.h
76
symbolDatabaseWarning:*/moc_*.cpp
87
simplifyUsing:*/moc_*.cpp
@@ -22,8 +21,6 @@ templateInstantiation:test/testutils.cpp
2221
naming-varname:externals/simplecpp/simplecpp.h
2322
naming-privateMemberVariable:externals/simplecpp/simplecpp.h
2423

25-
valueFlowMaxIterations:externals/tinyxml2/tinyxml2.cpp
26-
2724
# TODO: these warnings need to be addressed upstream
2825
uninitMemberVar:externals/tinyxml2/tinyxml2.h
2926
noExplicitConstructor:externals/tinyxml2/tinyxml2.h

cli/signalhandler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ static const Signalmap_t listofsignals = {
108108
* but when ending up here something went terribly wrong anyway.
109109
* And all which is left is just printing some information and terminate.
110110
*/
111-
// cppcheck-suppress constParameterCallback
112111
static void CppcheckSignalHandler(int signo, siginfo_t * info, void * context)
113112
{
114113
int type = -1;

gui/checkthread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static QString unquote(QString s) {
6363
}
6464

6565
// NOLINTNEXTLINE(performance-unnecessary-value-param) - used as callback so we need to preserve the signature
66-
int CheckThread::executeCommand(std::string exe, std::vector<std::string> args, std::string redirect, std::string &output) // cppcheck-suppress [passedByValue,passedByValueCallback]
66+
int CheckThread::executeCommand(std::string exe, std::vector<std::string> args, std::string redirect, std::string &output) // cppcheck-suppress passedByValueCallback
6767
{
6868
output.clear();
6969

lib/checkclass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3131,7 +3131,6 @@ void CheckClass::checkCopyCtorAndEqOperator()
31313131
{
31323132
// This is disabled because of #8388
31333133
// The message must be clarified. How is the behaviour different?
3134-
// cppcheck-suppress unreachableCode - remove when code is enabled again
31353134
if ((true) || !mSettings->severity.isEnabled(Severity::warning)) // NOLINT(readability-simplify-boolean-expr)
31363135
return;
31373136

lib/checkcondition.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,6 @@ void CheckCondition::checkIncorrectLogicOperator()
13211321
const std::string text = cond1str + " " + tok->str() + " " + cond2str;
13221322
incorrectLogicOperatorError(tok, text, alwaysTrue, inconclusive, std::move(errorPath));
13231323
} else if (printStyle && (firstTrue || secondTrue)) {
1324-
// cppcheck-suppress accessMoved - TODO: FP - see #12174
13251324
const int which = isfloat ? sufficientCondition(std::move(op1), not1, d1, std::move(op2), not2, d2, isAnd) : sufficientCondition(std::move(op1), not1, i1, std::move(op2), not2, i2, isAnd);
13261325
std::string text;
13271326
if (which != 0) {

lib/checkunusedfunctions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,9 +522,7 @@ void CheckUnusedFunctions::updateFunctionData(const CheckUnusedFunctions& check)
522522
usage.fileIndex = entry.second.fileIndex;
523523
if (usage.filename.empty())
524524
usage.filename = entry.second.filename;
525-
// cppcheck-suppress bitwiseOnBoolean - TODO: FP
526525
usage.usedOtherFile |= entry.second.usedOtherFile;
527-
// cppcheck-suppress bitwiseOnBoolean - TODO: FP
528526
usage.usedSameFile |= entry.second.usedSameFile;
529527
}
530528
mFunctionDecl.insert(mFunctionDecl.cend(), check.mFunctionDecl.cbegin(), check.mFunctionDecl.cend());

lib/keywords.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ static const std::unordered_set<std::string> cpp26_keywords_all = {
169169
// cppcheck-suppress unusedFunction
170170
const std::unordered_set<std::string>& Keywords::getAll(Standards::cstd_t cStd)
171171
{
172-
// cppcheck-suppress missingReturn
173172
switch (cStd) {
174173
case Standards::cstd_t::C89:
175174
return c89_keywords_all;
@@ -187,7 +186,6 @@ const std::unordered_set<std::string>& Keywords::getAll(Standards::cstd_t cStd)
187186

188187
// cppcheck-suppress unusedFunction
189188
const std::unordered_set<std::string>& Keywords::getAll(Standards::cppstd_t cppStd) {
190-
// cppcheck-suppress missingReturn
191189
switch (cppStd) {
192190
case Standards::cppstd_t::CPP03:
193191
return cpp03_keywords_all;
@@ -210,7 +208,6 @@ const std::unordered_set<std::string>& Keywords::getAll(Standards::cppstd_t cppS
210208
// cppcheck-suppress unusedFunction
211209
const std::unordered_set<std::string>& Keywords::getOnly(Standards::cstd_t cStd)
212210
{
213-
// cppcheck-suppress missingReturn
214211
switch (cStd) {
215212
case Standards::cstd_t::C89:
216213
return c89_keywords;
@@ -229,7 +226,6 @@ const std::unordered_set<std::string>& Keywords::getOnly(Standards::cstd_t cStd)
229226
// cppcheck-suppress unusedFunction
230227
const std::unordered_set<std::string>& Keywords::getOnly(Standards::cppstd_t cppStd)
231228
{
232-
// cppcheck-suppress missingReturn
233229
switch (cppStd) {
234230
case Standards::cppstd_t::CPP03:
235231
return cpp03_keywords;

lib/path.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ static bool hasEmacsCppMarker(const char* path)
318318

319319
Standards::Language Path::identify(const std::string &path, bool cppHeaderProbe, bool *header)
320320
{
321-
// cppcheck-suppress uninitvar - TODO: FP
322321
if (header)
323322
*header = false;
324323

@@ -336,7 +335,6 @@ Standards::Language Path::identify(const std::string &path, bool cppHeaderProbe,
336335
return Standards::Language::CPP;
337336
if (c_src_exts.find(ext) != c_src_exts.end())
338337
return Standards::Language::C;
339-
// cppcheck-suppress knownConditionTrueFalse - TODO: FP
340338
if (!caseInsensitiveFilesystem())
341339
strTolower(ext);
342340
if (ext == ".h") {

lib/smallvector.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ template<class T, std::size_t N>
3636
struct TaggedAllocator : std::allocator<T>
3737
{
3838
template<class ... Ts>
39-
// cppcheck-suppress noExplicitConstructor
4039
// NOLINTNEXTLINE(google-explicit-constructor)
4140
TaggedAllocator(Ts&&... ts)
4241
: std::allocator<T>(std::forward<Ts>(ts)...)

lib/symboldatabase.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,14 +1435,12 @@ class CPPCHECKLIB SymbolDatabase {
14351435
void createSymbolDatabaseNeedInitialization();
14361436
void createSymbolDatabaseVariableSymbolTable();
14371437
void createSymbolDatabaseSetScopePointers();
1438-
void createSymbolDatabaseSetFunctionPointers(bool firstPass); // cppcheck-suppress functionConst // has side effects
1438+
void createSymbolDatabaseSetFunctionPointers(bool firstPass);
14391439
void createSymbolDatabaseSetVariablePointers();
1440-
// cppcheck-suppress functionConst
14411440
void createSymbolDatabaseSetTypePointers();
14421441
void createSymbolDatabaseSetSmartPointerType();
1443-
void createSymbolDatabaseEnums(); // cppcheck-suppress functionConst // has side effects
1444-
void createSymbolDatabaseEscapeFunctions(); // cppcheck-suppress functionConst // has side effects
1445-
// cppcheck-suppress functionConst
1442+
void createSymbolDatabaseEnums();
1443+
void createSymbolDatabaseEscapeFunctions();
14461444
void createSymbolDatabaseIncompleteVars();
14471445

14481446
void debugSymbolDatabase() const;

lib/tokenize.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3578,7 +3578,6 @@ void Tokenizer::concatenateNegativeNumberAndAnyPositive()
35783578
tok->deleteNext();
35793579

35803580
if (Token::Match(tok->next(), "+|- %num%")) {
3581-
// cppcheck-suppress redundantCopyLocalConst - cannot make it a reference because it is deleted afterwards
35823581
std::string prefix = tok->strAt(1);
35833582
tok->deleteNext();
35843583
tok->next()->str(prefix + tok->strAt(1));

lib/tokenize.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class CPPCHECKLIB Tokenizer {
133133

134134
/** Insert array size where it isn't given */
135135
void arraySize();
136-
void arraySizeAfterValueFlow(); // cppcheck-suppress functionConst
136+
void arraySizeAfterValueFlow();
137137

138138
/** Simplify labels and 'case|default' syntaxes.
139139
*/
@@ -165,7 +165,7 @@ class CPPCHECKLIB Tokenizer {
165165
* \param only_k_r_fpar Only simplify K&R function parameters
166166
*/
167167
void simplifyVarDecl( bool only_k_r_fpar);
168-
void simplifyVarDecl(Token * tokBegin, const Token * tokEnd, bool only_k_r_fpar); // cppcheck-suppress functionConst // has side effects
168+
void simplifyVarDecl(Token * tokBegin, const Token * tokEnd, bool only_k_r_fpar);
169169

170170
/**
171171
* Simplify variable initialization

lib/valueflow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5821,7 +5821,7 @@ static void addToErrorPath(ValueFlow::Value& value, const ValueFlow::Value& from
58215821
}
58225822

58235823
static std::vector<Token*> findAllUsages(const Variable* var,
5824-
Token* start, // cppcheck-suppress constParameterPointer // FP
5824+
Token* start,
58255825
const Library& library)
58265826
{
58275827
// std::vector<Token*> result;

lib/vf_settokenvalue.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ namespace ValueFlow
404404
}
405405
} else if (!value.isImpossible()) {
406406
// is condition only depending on 1 variable?
407-
// cppcheck-suppress[variableScope] #8541
408407
nonneg int varId = 0;
409408
bool ret = false;
410409
visitAstNodes(parent->astOperand1(),

test/testother.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10576,7 +10576,6 @@ class TestOther : public TestFixture {
1057610576
// cppcheck-suppress unusedPrivateFunction
1057710577
void redundantMemWrite() {
1057810578
// Simple tests
10579-
// cppcheck-suppress unreachableCode - remove when code is enabled again
1058010579
check("void f() {\n"
1058110580
" char a[10];\n"
1058210581
" memcpy(a, foo, bar);\n"

test/testsimplifytokens.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1698,7 +1698,7 @@ class TestSimplifyTokens : public TestFixture {
16981698
}
16991699
}
17001700

1701-
// cppcheck-suppress unusedPrivateFunction
1701+
// TODO: cppcheck-suppress unusedPrivateFunction
17021702
void simplifyKnownVariables29() { // ticket #1811
17031703
{
17041704
const char code[] = "int foo(int u, int v)\n"

test/testtoken.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,11 @@ class TestToken : public TestFixture {
125125
Token *last = token->tokAt(2);
126126
ASSERT_EQUALS(token->str(), "1");
127127
ASSERT_EQUALS(token->strAt(1), "2");
128-
// cppcheck-suppress redundantNextPrevious - this is intentional
129128
ASSERT_EQUALS(token->tokAt(2)->str(), "3");
130129
ASSERT_EQUALS_MSG(true, last->next() == nullptr, "Null was expected");
131130

132131
ASSERT_EQUALS(last->str(), "3");
133132
ASSERT_EQUALS(last->strAt(-1), "2");
134-
// cppcheck-suppress redundantNextPrevious - this is intentional
135133
ASSERT_EQUALS(last->tokAt(-2)->str(), "1");
136134
ASSERT_EQUALS_MSG(true, token->previous() == nullptr, "Null was expected");
137135

@@ -767,24 +765,18 @@ class TestToken : public TestFixture {
767765

768766
void matchOr() const {
769767
const SimpleTokenList bitwiseOr(";|;");
770-
// cppcheck-suppress simplePatternError - this is intentional
771768
ASSERT_EQUALS(true, Token::Match(bitwiseOr.front(), "; %or%"));
772769
ASSERT_EQUALS(true, Token::Match(bitwiseOr.front(), "; %op%"));
773-
// cppcheck-suppress simplePatternError - this is intentional
774770
ASSERT_EQUALS(false, Token::Match(bitwiseOr.front(), "; %oror%"));
775771

776772
const SimpleTokenList bitwiseOrAssignment(";|=;");
777-
// cppcheck-suppress simplePatternError - this is intentional
778773
ASSERT_EQUALS(false, Token::Match(bitwiseOrAssignment.front(), "; %or%"));
779774
ASSERT_EQUALS(true, Token::Match(bitwiseOrAssignment.front(), "; %op%"));
780-
// cppcheck-suppress simplePatternError - this is intentional
781775
ASSERT_EQUALS(false, Token::Match(bitwiseOrAssignment.front(), "; %oror%"));
782776

783777
const SimpleTokenList logicalOr(";||;");
784-
// cppcheck-suppress simplePatternError - this is intentional
785778
ASSERT_EQUALS(false, Token::Match(logicalOr.front(), "; %or%"));
786779
ASSERT_EQUALS(true, Token::Match(logicalOr.front(), "; %op%"));
787-
// cppcheck-suppress simplePatternError - this is intentional
788780
ASSERT_EQUALS(true, Token::Match(logicalOr.front(), "; %oror%"));
789781
ASSERT_EQUALS(true, Token::Match(logicalOr.front(), "; &&|%oror%"));
790782
ASSERT_EQUALS(true, Token::Match(logicalOr.front(), "; %oror%|&&"));

0 commit comments

Comments
 (0)