Closed lcartey closed 9 months ago
void f3(int i) {
if (i < 0) {
throw foo();
}
}
void f4() noexcept {
f3(1);
}
void f5() noexcept {
f4(); // Exclude this call because it's to a noexcept function (i.e. assume noexcept functions can't throw, which is safe because if they do we will report it in that function)
}
Ideal solution: exclude calls to noexcept
functions.
Possible solution: exclude only results which directly call noexcept functions that throw (https://github.com/github/codeql-coding-standards/blob/main/cpp/autosar/src/rules/A15-4-2/NoExceptFunctionThrows.ql)
Affected rules
A15-4-2
ERR55-CPP
Description
noexcept
functions frequently call othernoexcept
functions. If anoexcept
function throws an exception, then we currently report that as a violation in everynoexcept
function that calls that function. This creates multiple alerts for one issues. We should instead report the original instance and not the others.Example