Skip to content

Commit

Permalink
Add changelog; tweaks based on MRVA results.
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelRFairhurst committed Sep 30, 2024
1 parent b297513 commit 6f860fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ import codingstandards.cpp.Noreturn

from Function f
where
not isExcluded(f, NoReturnPackage::returnStatementInNoreturnFunctionQuery()) and
not isExcluded(f, NoReturnPackage::functionWithNoReturningBranchShouldBeNoreturnQuery()) and
not f instanceof NoreturnFunction and
not mayReturn(f) and
f.hasDefinition() and
not f.getName() = "main" and // Allowed exception; _Noreturn main() is undefined behavior.
// Harden against c++ cases.
not f.isFromUninstantiatedTemplate(_) and
not f.isDeleted() and
not f.isCompilerGenerated()
select f,
"The function " + f.getName() + " cannot return and should be declared attribute _Noreturn."
"The function " + f.getName() + " cannot return and should be declared as _Noreturn."
3 changes: 3 additions & 0 deletions change_notes/2024-09-28-improved-noreturn-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- `A7-6-1`, `MSC53-CPP`, `RULE-9-6-4` - `FunctionNoReturnAttbrituteCondition.qll`
- 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.
- Exclude compiler generated functions from being reported.

0 comments on commit 6f860fc

Please sign in to comment.