Skip to content

Commit 6f860fc

Browse files
Add changelog; tweaks based on MRVA results.
1 parent b297513 commit 6f860fc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

c/misra/src/rules/RULE-17-11/FunctionWithNoReturningBranchShouldBeNoreturn.ql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ import codingstandards.cpp.Noreturn
1616

1717
from Function f
1818
where
19-
not isExcluded(f, NoReturnPackage::returnStatementInNoreturnFunctionQuery()) and
19+
not isExcluded(f, NoReturnPackage::functionWithNoReturningBranchShouldBeNoreturnQuery()) and
2020
not f instanceof NoreturnFunction and
2121
not mayReturn(f) and
2222
f.hasDefinition() and
2323
not f.getName() = "main" and // Allowed exception; _Noreturn main() is undefined behavior.
24+
// Harden against c++ cases.
25+
not f.isFromUninstantiatedTemplate(_) and
26+
not f.isDeleted() and
2427
not f.isCompilerGenerated()
2528
select f,
26-
"The function " + f.getName() + " cannot return and should be declared attribute _Noreturn."
29+
"The function " + f.getName() + " cannot return and should be declared as _Noreturn."
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- `A7-6-1`, `MSC53-CPP`, `RULE-9-6-4` - `FunctionNoReturnAttbrituteCondition.qll`
2+
- Analysis expanded from functions with "noreturn" attribute, now includes the "noreturn" specifier as well to handle new c rules. No difference in C++ results expected.
3+
- Exclude compiler generated functions from being reported.

0 commit comments

Comments
 (0)