File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -19,4 +19,4 @@ import codingstandards.cpp.InitializationContext
1919
2020from UninitializedVariable v
2121where not isExcluded ( v , Declarations7Package:: uninitializedVariableQuery ( ) )
22- select v , "Uninitialized variable found ."
22+ select v , "Variable '" + v . getName ( ) + "' has no initializer ."
Original file line number Diff line number Diff line change 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 . |
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ class A {
99
1010void 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
You can’t perform that action at this time.
0 commit comments