File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
cpp/ql/test/query-tests/Critical/NotInitialised Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ | test.cpp:3:11:3:15 | local | Variable 'local' is not initialized. |
2+ | test.cpp:12:5:12:24 | uninitialised_global | Variable 'uninitialised_global' is not initialized. |
Original file line number Diff line number Diff line change 1+ Critical/NotInitialised.ql
Original file line number Diff line number Diff line change 1+ void test1 () {
2+ int local;
3+ int x = local; // BAD
4+
5+ static int static_local;
6+ int y = static_local; // GOOD
7+
8+ int initialised = 42 ;
9+ int z = initialised; // GOOD
10+ }
11+
12+ int uninitialised_global; // BAD
13+ static int uninitialised_static_global; // GOOD
14+ int initialized_global = 0 ; // GOOD
15+
16+ void test2 () {
17+ int a = uninitialised_global;
18+ int b = uninitialised_static_global;
19+ int c = initialized_global;
20+ }
You can’t perform that action at this time.
0 commit comments