Skip to content

Commit 35d1479

Browse files
boosPKEuS
authored andcommitted
CWE mapping of funcArgOrderDifferent, funcArgNamesDifferent (#885)
Add an optional extended description…
1 parent 164df2a commit 35d1479

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/checkother.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ static const struct CWE CWE563(563U); // Assignment to Variable without Use ('
4646
static const struct CWE CWE570(570U); // Expression is Always False
4747
static const struct CWE CWE571(571U); // Expression is Always True
4848
static const struct CWE CWE672(672U); // Operation on a Resource after Expiration or Release
49+
static const struct CWE CWE628(628U); // Function Call with Incorrectly Specified Arguments
50+
static const struct CWE CWE683(683U); // Function Call With Incorrect Order of Arguments
4951
static const struct CWE CWE686(686U); // Function Call With Incorrect Argument Type
5052
static const struct CWE CWE687(687U); // Function Call With Incorrectly Specified Argument Value
5153
static const struct CWE CWE688(688U); // Function Call With Incorrect Variable or Reference as Argument
@@ -2875,7 +2877,7 @@ void CheckOther::funcArgNamesDifferent(const std::string & functionName, size_t
28752877
reportError(tokens, Severity::style, "funcArgNamesDifferent",
28762878
"Function '" + functionName + "' argument " + MathLib::toString(index + 1) + " names different: declaration '" +
28772879
(declaration ? declaration->str() : std::string("A")) + "' definition '" +
2878-
(definition ? definition->str() : std::string("B")) + "'.", CWE(0U), true);
2880+
(definition ? definition->str() : std::string("B")) + "'.", CWE628, true);
28792881
}
28802882

28812883
void CheckOther::funcArgOrderDifferent(const std::string & functionName,
@@ -2901,6 +2903,6 @@ void CheckOther::funcArgOrderDifferent(const std::string & functionName,
29012903
msg += definitions[i]->str();
29022904
}
29032905
msg += "'";
2904-
reportError(tokens, Severity::warning, "funcArgOrderDifferent", msg, CWE(0U), false);
2906+
reportError(tokens, Severity::warning, "funcArgOrderDifferent", msg, CWE683, false);
29052907
}
29062908

0 commit comments

Comments
 (0)