Skip to content

Commit 00316dc

Browse files
authored
Merge pull request #4120 from github/igfoo/global_vars
C++: Give fewer types to global variables
2 parents 9ef8276 + 3ead154 commit 00316dc

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
| a.c:4:5:4:6 | definition of is | array of {int} | 1 |
2+
| a.h:2:12:2:13 | declaration of is | array of 4 {int} | 1 |
3+
| file://:0:0:0:0 | definition of fp_offset | unsigned int | 1 |
4+
| file://:0:0:0:0 | definition of gp_offset | unsigned int | 1 |
5+
| file://:0:0:0:0 | definition of overflow_arg_area | pointer to {void} | 1 |
6+
| file://:0:0:0:0 | definition of reg_save_area | pointer to {void} | 1 |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import cpp
2+
3+
from VariableDeclarationEntry vd, Type t
4+
where t = vd.getType()
5+
select vd, t.explain(), count(Type u | u = vd.getType())

cpp/ql/test/library-tests/variables/global/variables.expected

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
| a.c:4:5:4:6 | is | array of 4 {int} | 2 |
2-
| a.c:4:5:4:6 | is | array of {int} | 2 |
1+
| a.c:4:5:4:6 | is | array of {int} | 1 |
32
| file://:0:0:0:0 | fp_offset | unsigned int | 1 |
43
| file://:0:0:0:0 | gp_offset | unsigned int | 1 |
54
| file://:0:0:0:0 | overflow_arg_area | pointer to {void} | 1 |

0 commit comments

Comments
 (0)