-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix #11483 FN unusedFunction for method with inline implementation #4692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6b6eb0e
d2fe8a1
b375eb3
3b55338
fe2e2c7
5ee948e
1478626
53bd055
51fe6b5
402326a
a890bca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -118,6 +118,7 @@ class CPPCHECKLIB Library { | |
| } | ||
|
|
||
| /** get allocation id for function by name (deprecated, use other alloc) */ | ||
| // cppcheck-suppress unusedFunction - only used in unit tests | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would drop the mention of unit tests for obvious helper functions like this. Same for the other methods in this file. I will review this in more detail later on though. |
||
| int allocId(const char name[]) const { | ||
| const AllocFunc* af = getAllocDealloc(mAlloc, name); | ||
| return af ? af->groupId : 0; | ||
|
|
@@ -130,23 +131,27 @@ class CPPCHECKLIB Library { | |
| } | ||
|
|
||
| /** set allocation id for function */ | ||
| // cppcheck-suppress unusedFunction - only used in unit tests | ||
| void setalloc(const std::string &functionname, int id, int arg) { | ||
| mAlloc[functionname].groupId = id; | ||
| mAlloc[functionname].arg = arg; | ||
| } | ||
|
|
||
| // cppcheck-suppress unusedFunction - only used in unit tests | ||
| void setdealloc(const std::string &functionname, int id, int arg) { | ||
| mDealloc[functionname].groupId = id; | ||
| mDealloc[functionname].arg = arg; | ||
| } | ||
|
|
||
| // cppcheck-suppress unusedFunction - only used in unit tests | ||
| void setrealloc(const std::string &functionname, int id, int arg, int reallocArg = 1) { | ||
| mRealloc[functionname].groupId = id; | ||
| mRealloc[functionname].arg = arg; | ||
| mRealloc[functionname].reallocArg = reallocArg; | ||
| } | ||
|
|
||
| /** add noreturn function setting */ | ||
| // cppcheck-suppress unusedFunction - only used in unit tests | ||
| void setnoreturn(const std::string& funcname, bool noreturn) { | ||
| mNoReturn[funcname] = noreturn ? FalseTrueMaybe::True : FalseTrueMaybe::False; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1409,10 +1409,6 @@ class CPPCHECKLIB SymbolDatabase { | |
| return const_cast<Scope *>(this->findScope(tok, const_cast<const Scope *>(startScope))); | ||
| } | ||
|
|
||
| bool isVarId(nonneg int varid) const { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should keep this for now. |
||
| return varid < mVariableList.size(); | ||
| } | ||
|
|
||
| const Variable *getVariableFromVarId(nonneg int varId) const { | ||
| return mVariableList.at(varId); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -460,12 +460,6 @@ class CPPCHECKLIB Token { | |
| void isSigned(const bool sign) { | ||
| setFlag(fIsSigned, sign); | ||
| } | ||
| bool isPointerCompare() const { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should keep this even if it isn't used. Same for the other methods in this file. |
||
| return getFlag(fIsPointerCompare); | ||
| } | ||
| void isPointerCompare(const bool b) { | ||
| setFlag(fIsPointerCompare, b); | ||
| } | ||
| bool isLong() const { | ||
| return getFlag(fIsLong); | ||
| } | ||
|
|
@@ -562,9 +556,6 @@ class CPPCHECKLIB Token { | |
| bool getCppcheckAttribute(TokenImpl::CppcheckAttributes::Type type, MathLib::bigint &value) const { | ||
| return mImpl->getCppcheckAttribute(type, value); | ||
| } | ||
| bool hasCppcheckAttributes() const { | ||
| return nullptr != mImpl->mCppcheckAttributes; | ||
| } | ||
| bool isControlFlowKeyword() const { | ||
| return getFlag(fIsControlFlowKeyword); | ||
| } | ||
|
|
@@ -690,9 +681,6 @@ class CPPCHECKLIB Token { | |
| setFlag(fIsFinalType, b); | ||
| } | ||
|
|
||
| bool isBitfield() const { | ||
| return mImpl->mBits > 0; | ||
| } | ||
| unsigned char bits() const { | ||
| return mImpl->mBits; | ||
| } | ||
|
|
@@ -936,6 +924,7 @@ class CPPCHECKLIB Token { | |
| options.files = true; | ||
| return options; | ||
| } | ||
| // cppcheck-suppress unusedFunction - only used in unit tests | ||
| static stringifyOptions forDebugVarId() { | ||
| stringifyOptions options = forDebug(); | ||
| options.varid = true; | ||
|
|
@@ -1267,7 +1256,7 @@ class CPPCHECKLIB Token { | |
| enum : uint64_t { | ||
| fIsUnsigned = (1 << 0), | ||
| fIsSigned = (1 << 1), | ||
| fIsPointerCompare = (1 << 2), | ||
|
|
||
| fIsLong = (1 << 3), | ||
| fIsStandardType = (1 << 4), | ||
| fIsExpandedMacro = (1 << 5), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not change external files. Put it in the suppression file.