Skip to content

Commit b653506

Browse files
committed
Address feedback comments
1 parent 645a1d7 commit b653506

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

cpp/misra/src/rules/RULE-11-6-1/UninitializedVariable.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ import codingstandards.cpp.InitializationContext
1919

2020
from UninitializedVariable v
2121
where not isExcluded(v, Declarations7Package::uninitializedVariableQuery())
22-
select v, "Uninitialized variable found."
22+
select v, "Variable '" + v.getName() + "' has no initializer."
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| test.cpp:11:7:11:7 | i | Uninitialized variable found. |
2-
| test.cpp:18:8:18:9 | i4 | Uninitialized variable found. |
3-
| test.cpp:20:8:20:9 | p4 | Uninitialized variable found. |
1+
| test.cpp:11:7:11:7 | i | Variable 'i' has no initializer. |
2+
| test.cpp:19:8:19:9 | i4 | Variable 'i4' has no initializer. |
3+
| test.cpp:21:8:21:9 | p4 | Variable 'p4' has no initializer. |

cpp/misra/test/rules/RULE-11-6-1/test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class A {
99

1010
void f(int p) { // COMPLIANT - not applicable to parameters
1111
int i; // NON_COMPLIANT
12+
i = 0; // not affected by later assignments
1213
int i1 = 0; // COMPLIANT
1314
int i2[10] = {1, 0}; // COMPLIANT
1415
int i3[10]; // COMPLIANT

0 commit comments

Comments
 (0)