Skip to content

Commit 3dc5aa4

Browse files
Address feedback
1 parent 4cc50dd commit 3dc5aa4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

cpp/common/src/codingstandards/cpp/Function.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class FunctionAccessExpr extends FunctionAccess, FunctionAccessLikeExpr {
4747
}
4848

4949
/**
50-
* Taking an address of a function access in effectively a function access.
50+
* Taking the address of a function access in effectively a function access.
5151
*/
5252
class FunctionAddressExpr extends AddressOfExpr, FunctionAccessLikeExpr {
5353
Function func;

cpp/common/src/codingstandards/cpp/exceptions/SpecialFunctionExceptions.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class FunctionGivenToStdExitHandler extends FunctionAccess, SpecialUseOfFunction
9292
override string getSpecialDescription(Locatable extra, string extraString) {
9393
result = "$@" and
9494
extra = exitHandlerCall and
95-
extraString = "passed exit handler std::" + exitHandler.getName()
95+
extraString = "passed to the exit handler std::" + exitHandler.getName()
9696
}
9797
}
9898

cpp/misra/src/rules/RULE-18-3-1/MissingCatchAllExceptionHandlerInMain.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import cpp
1717
import codingstandards.cpp.misra
18+
import codingstandards.cpp.EncapsulatingFunctions
1819
import codingstandards.cpp.exceptions.ExceptionFlow
1920
import codingstandards.cpp.exceptions.ExceptionSpecifications
2021

@@ -24,7 +25,7 @@ import codingstandards.cpp.exceptions.ExceptionSpecifications
2425
*/
2526
class UncaughtFunctionCallInMain extends FunctionCall {
2627
UncaughtFunctionCallInMain() {
27-
getEnclosingFunction().hasName("main") and
28+
getEnclosingFunction() instanceof MainFunction and
2829
not isNoExceptTrue(getTarget()) and
2930
not exists(TryStmt try |
3031
try = getATryStmt(this.getEnclosingStmt()) and
@@ -46,10 +47,9 @@ class UncaughtFunctionCallInMain extends FunctionCall {
4647
}
4748
}
4849

49-
from Function f, UncaughtFunctionCallInMain fc
50+
from MainFunction f, UncaughtFunctionCallInMain fc
5051
where
5152
not isExcluded(f, Exceptions3Package::missingCatchAllExceptionHandlerInMainQuery()) and
52-
f.getName() = "main" and
5353
fc.isFirst()
5454
select f,
5555
"Main function has a $@ which is not within a try block with a catch-all ('catch(...)') handler.",

cpp/misra/src/rules/RULE-18-4-1/ExceptionUnfriendlyFunctionMustBeNoexcept.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @id cpp/misra/exception-unfriendly-function-must-be-noexcept
33
* @name RULE-18-4-1: Exception-unfriendly functions shall be noexcept
4-
* @description Throwing exceptions in constructors, descructors, copy-constructors, move
4+
* @description Throwing exceptions in constructors, destructors, copy-constructors, move
55
* constructors, assignments, and functions named swap, may result in
66
* implementation-defined behavior.
77
* @kind problem

rule_packages/cpp/Exceptions3.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"queries": [
5252
{
53-
"description": "Throwing exceptions in constructors, descructors, copy-constructors, move constructors, assignments, and functions named swap, may result in implementation-defined behavior.",
53+
"description": "Throwing exceptions in constructors, destructors, copy-constructors, move constructors, assignments, and functions named swap, may result in implementation-defined behavior.",
5454
"kind": "problem",
5555
"name": "Exception-unfriendly functions shall be noexcept",
5656
"precision": "very-high",

0 commit comments

Comments
 (0)