Skip to content

Commit 1cb417c

Browse files
committed
Declarations1: minor query improvements
1 parent d073b11 commit 1cb417c

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

c/cert/src/rules/DCL31-C/DeclareIdentifiersBeforeUsingThem.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ where
2525
// Exclude "signed" or "unsigned", as opposed to "signed int" or "unsigned int".
2626
not exists(IntegralType it | it = t | it.isExplicitlySigned() or it.isExplicitlyUnsigned())
2727
)
28-
select d, "Declaration is missing a type specifier."
28+
select d, "Declaration " + d.getName() + " is missing a type specifier."
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.c:1:8:1:8 | g | Declaration is missing a type specifier. |
2-
| test.c:5:1:5:1 | f | Declaration is missing a type specifier. |
1+
| test.c:1:8:1:8 | g | Declaration g is missing a type specifier. |
2+
| test.c:5:1:5:1 | f | Declaration f is missing a type specifier. |

c/misra/src/rules/RULE-5-4/MacroIdentifierNotDistinctFromParameter.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* @id c/misra/macro-identifier-not-distinct-from-parameter
3-
* @name RULE-5-4: Macro identifiers shall be distinct
3+
* @name RULE-5-4: Macro identifiers shall be distinct from paramters
44
* @description Macros with the same name as their parameters are less readable.
55
* @kind problem
66
* @precision very-high

rule_packages/c/Declarations1.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"readability"
9393
],
9494
"implementation_scope": {
95-
"description": "This query checks the first 31 characters of identifiers as significant, as per C99. This query does not consider universal or extended source characters.",
95+
"description": "This query considers the first 31 characters of identifiers as significant, as per C99 and reports the case when names are longer than 31 characters and differ in those characters past the 31 first only. This query does not consider universal or extended source characters.",
9696
"items": []
9797
}
9898
}
@@ -124,7 +124,7 @@
124124
{
125125
"description": "Macros with the same name as their parameters are less readable.",
126126
"kind": "problem",
127-
"name": "Macro identifiers shall be distinct",
127+
"name": "Macro identifiers shall be distinct from paramters",
128128
"precision": "very-high",
129129
"severity": "warning",
130130
"short_name": "MacroIdentifierNotDistinctFromParameter",

0 commit comments

Comments
 (0)