Skip to content

Commit 1408a85

Browse files
committed
Address minor things for Actions
1 parent 2c1ea82 commit 1408a85

File tree

3 files changed

+38
-56
lines changed

3 files changed

+38
-56
lines changed

c/misra/src/rules/DIR-4-6/TypedefsThatIndicateSizeAndSig.ql

Lines changed: 0 additions & 18 deletions
This file was deleted.

cpp/common/src/codingstandards/cpp/exclusions/c/Types.qll

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,92 +4,92 @@ import RuleMetadata
44
import codingstandards.cpp.exclusions.RuleMetadata
55

66
newtype TypesQuery =
7-
TExprShiftedbyNegativeOrGreaterPrecisionOperandQuery() or
8-
TConvertingAPointerToIntegerOrIntegerToPointerQuery() or
9-
TPlainNumericalTypeUsedOverExplicitTypedefQuery() or
10-
TSizeofOperatorUsedOnArrayTypeParamQuery() or
11-
TStringLiteralAssignedToNonConstCharQuery()
7+
TExprShiftedbyNegativeOrGreaterPrecisionOperandQuery() or
8+
TConvertingAPointerToIntegerOrIntegerToPointerQuery() or
9+
TPlainNumericalTypeUsedOverExplicitTypedefQuery() or
10+
TSizeofOperatorUsedOnArrayTypeParamQuery() or
11+
TStringLiteralAssignedToNonConstCharQuery()
1212

1313
predicate isTypesQueryMetadata(Query query, string queryId, string ruleId, string category) {
1414
query =
1515
// `Query` instance for the `exprShiftedbyNegativeOrGreaterPrecisionOperand` query
16-
TypesPackage::exprShiftedbyNegativeOrGreaterPrecisionOperandQuery() and
16+
TypesPackage::exprShiftedbyNegativeOrGreaterPrecisionOperandQuery() and
1717
queryId =
1818
// `@id` for the `exprShiftedbyNegativeOrGreaterPrecisionOperand` query
19-
"c/cert/expr-shiftedby-negative-or-greater-precision-operand" and
19+
"c/cert/expr-shiftedby-negative-or-greater-precision-operand" and
2020
ruleId = "INT34-C" and
2121
category = "rule"
2222
or
2323
query =
2424
// `Query` instance for the `convertingAPointerToIntegerOrIntegerToPointer` query
25-
TypesPackage::convertingAPointerToIntegerOrIntegerToPointerQuery() and
25+
TypesPackage::convertingAPointerToIntegerOrIntegerToPointerQuery() and
2626
queryId =
2727
// `@id` for the `convertingAPointerToIntegerOrIntegerToPointer` query
28-
"c/cert/converting-a-pointer-to-integer-or-integer-to-pointer" and
28+
"c/cert/converting-a-pointer-to-integer-or-integer-to-pointer" and
2929
ruleId = "INT36-C" and
3030
category = "rule"
3131
or
3232
query =
3333
// `Query` instance for the `plainNumericalTypeUsedOverExplicitTypedef` query
34-
TypesPackage::plainNumericalTypeUsedOverExplicitTypedefQuery() and
34+
TypesPackage::plainNumericalTypeUsedOverExplicitTypedefQuery() and
3535
queryId =
3636
// `@id` for the `plainNumericalTypeUsedOverExplicitTypedef` query
37-
"c/misra/plain-numerical-type-used-over-explicit-typedef" and
37+
"c/misra/plain-numerical-type-used-over-explicit-typedef" and
3838
ruleId = "DIR-4-6" and
3939
category = "advisory"
4040
or
4141
query =
4242
// `Query` instance for the `sizeofOperatorUsedOnArrayTypeParam` query
43-
TypesPackage::sizeofOperatorUsedOnArrayTypeParamQuery() and
43+
TypesPackage::sizeofOperatorUsedOnArrayTypeParamQuery() and
4444
queryId =
4545
// `@id` for the `sizeofOperatorUsedOnArrayTypeParam` query
46-
"c/misra/sizeof-operator-used-on-array-type-param" and
46+
"c/misra/sizeof-operator-used-on-array-type-param" and
4747
ruleId = "RULE-12-5" and
4848
category = "mandatory"
4949
or
5050
query =
5151
// `Query` instance for the `stringLiteralAssignedToNonConstChar` query
52-
TypesPackage::stringLiteralAssignedToNonConstCharQuery() and
52+
TypesPackage::stringLiteralAssignedToNonConstCharQuery() and
5353
queryId =
5454
// `@id` for the `stringLiteralAssignedToNonConstChar` query
55-
"c/misra/string-literal-assigned-to-non-const-char" and
55+
"c/misra/string-literal-assigned-to-non-const-char" and
5656
ruleId = "RULE-7-4" and
5757
category = "required"
5858
}
5959

6060
module TypesPackage {
61-
Query exprShiftedbyNegativeOrGreaterPrecisionOperandQuery() {
61+
Query exprShiftedbyNegativeOrGreaterPrecisionOperandQuery() {
6262
//autogenerate `Query` type
63-
result =
63+
result =
6464
// `Query` type for `exprShiftedbyNegativeOrGreaterPrecisionOperand` query
65-
TQueryC(TTypesPackageQuery(TExprShiftedbyNegativeOrGreaterPrecisionOperandQuery()))
66-
}
65+
TQueryC(TTypesPackageQuery(TExprShiftedbyNegativeOrGreaterPrecisionOperandQuery()))
66+
}
6767

68-
Query convertingAPointerToIntegerOrIntegerToPointerQuery() {
68+
Query convertingAPointerToIntegerOrIntegerToPointerQuery() {
6969
//autogenerate `Query` type
70-
result =
70+
result =
7171
// `Query` type for `convertingAPointerToIntegerOrIntegerToPointer` query
72-
TQueryC(TTypesPackageQuery(TConvertingAPointerToIntegerOrIntegerToPointerQuery()))
73-
}
72+
TQueryC(TTypesPackageQuery(TConvertingAPointerToIntegerOrIntegerToPointerQuery()))
73+
}
7474

75-
Query plainNumericalTypeUsedOverExplicitTypedefQuery() {
75+
Query plainNumericalTypeUsedOverExplicitTypedefQuery() {
7676
//autogenerate `Query` type
77-
result =
77+
result =
7878
// `Query` type for `plainNumericalTypeUsedOverExplicitTypedef` query
79-
TQueryC(TTypesPackageQuery(TPlainNumericalTypeUsedOverExplicitTypedefQuery()))
80-
}
79+
TQueryC(TTypesPackageQuery(TPlainNumericalTypeUsedOverExplicitTypedefQuery()))
80+
}
8181

82-
Query sizeofOperatorUsedOnArrayTypeParamQuery() {
82+
Query sizeofOperatorUsedOnArrayTypeParamQuery() {
8383
//autogenerate `Query` type
84-
result =
84+
result =
8585
// `Query` type for `sizeofOperatorUsedOnArrayTypeParam` query
86-
TQueryC(TTypesPackageQuery(TSizeofOperatorUsedOnArrayTypeParamQuery()))
87-
}
86+
TQueryC(TTypesPackageQuery(TSizeofOperatorUsedOnArrayTypeParamQuery()))
87+
}
8888

89-
Query stringLiteralAssignedToNonConstCharQuery() {
89+
Query stringLiteralAssignedToNonConstCharQuery() {
9090
//autogenerate `Query` type
91-
result =
91+
result =
9292
// `Query` type for `stringLiteralAssignedToNonConstChar` query
93-
TQueryC(TTypesPackageQuery(TStringLiteralAssignedToNonConstCharQuery()))
94-
}
93+
TQueryC(TTypesPackageQuery(TStringLiteralAssignedToNonConstCharQuery()))
94+
}
9595
}

rule_packages/c/Types.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@
367367
{
368368
"description": "Using sizeof operator on an array type function parameter leads to unintended results.",
369369
"kind": "problem",
370-
"name": "The sizeof operator should not be used on an array type function parameter.",
370+
"name": "The sizeof operator should not be used on an array type function parameter",
371371
"precision": "very-high",
372372
"severity": "error",
373373
"short_name": "SizeofOperatorUsedOnArrayTypeParam",
@@ -469,7 +469,7 @@
469469
{
470470
"description": "Assigning string literal to a variable with type other than a pointer to const char and modifying it causes undefined behavior .",
471471
"kind": "problem",
472-
"name": "A string literal shall only be assigned to a pointer to const char.",
472+
"name": "A string literal shall only be assigned to a pointer to const char",
473473
"precision": "very-high",
474474
"severity": "error",
475475
"short_name": "StringLiteralAssignedToNonConstChar",
@@ -479,4 +479,4 @@
479479
"title": "A string literal shall not be assigned to an object unless the object's type is 'pointer to const-qualified char'"
480480
}
481481
}
482-
}
482+
}

0 commit comments

Comments
 (0)