1 Consider compiling test.c, with this content:
2 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
6 main (int argc, char **argv)
12 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 ...where test.h has this content:
15 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
18 #define PLUS(A, B) A + B
19 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 The undocumented -fdump-internal-locations option outputs this information
23 to stderr, showing what each source_location value means. Source code
24 lines are quoted, showing both per-line source_location values and
25 per-line&column source_location values (written vertically under the
26 corresponding character of source code).
28 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
30 source_location interval: 0 <= loc < 2
33 source_location interval: 2 <= loc < 3
37 test.c: 1|loc: 2|#include "test.h"
42 source_location interval: 3 <= loc < 4
48 source_location interval: 4 <= loc < 5
54 source_location interval: 5 <= loc < 5005
55 file: /usr/include/stdc-predef.h
58 (contents of /usr/include/stdc-predef.h snipped for brevity)
61 source_location interval: 5005 <= loc < 5006
67 source_location interval: 5006 <= loc < 5134
71 test.c: 1|loc: 5006|#include "test.h"
78 source_location interval: 5134 <= loc < 5416
82 test.h: 1|loc: 5134|extern int foo ();
92 test.h: 3|loc: 5390|#define PLUS(A, B) A + B
93 |555555555555555555555555
94 |333333333444444444444444
95 |999999999000000000011111
96 |123456789012345678901234
99 source_location interval: 5416 <= loc < 6314
108 test.c: 3|loc: 5544|int
113 test.c: 4|loc: 5672|main (int argc, char **argv)
114 |5555555555555555555555555555
115 |6666666666666666666666666667
116 |7777777888888888899999999990
117 |3456789012345678901234567890
118 test.c: 5|loc: 5800|{
123 test.c: 6|loc: 5928| int a = PLUS (1,2);
124 |555555555555555555555
125 |999999999999999999999
126 |233333333334444444444
127 |901234567890123456789
128 test.c: 7|loc: 6056| int b = PLUS (3,4);
129 |666666666666666666666
130 |000000000000000000000
131 |555666666666677777777
132 |789012345678901234567
133 test.c: 8|loc: 6184| return 0;
138 test.c: 9|loc: 6312|}
144 UNALLOCATED LOCATIONS
145 source_location interval: 6314 <= loc < 2147483633
147 MACRO 1: PLUS (7 tokens)
148 source_location interval: 2147483633 <= loc < 2147483640
149 test.c:7:11: note: expansion point is location 6067
152 map->start_location: 2147483633
155 test.c:7:17: note: token 0 has x-location == 6073
158 test.c:7:17: note: token 0 has y-location == 5410
160 In file included from test.c:1:0:
161 test.h:3:22: note: token 1 has x-location == y-location == 5412
162 #define PLUS(A, B) A + B
165 test.c:7:19: note: token 2 has x-location == 6075
168 test.c:7:19: note: token 2 has y-location == 5414
170 cc1: note: token 3 has x-location == 0
171 cc1: note: token 3 has y-location == 2947526575
172 4: 2947526575, 2947526575
173 x-location == y-location == 2947526575 encodes token # 800042942
174 5: 2947526575, 2947526575
175 x-location == y-location == 2947526575 encodes token # 800042942
176 6: 2947526575, 2947526575
177 x-location == y-location == 2947526575 encodes token # 800042942
179 MACRO 0: PLUS (7 tokens)
180 source_location interval: 2147483640 <= loc < 2147483647
181 test.c:6:11: note: expansion point is location 5939
184 map->start_location: 2147483640
187 test.c:6:17: note: token 0 has x-location == 5945
190 test.c:6:17: note: token 0 has y-location == 5410
192 In file included from test.c:1:0:
193 test.h:3:22: note: token 1 has x-location == y-location == 5412
194 #define PLUS(A, B) A + B
197 test.c:6:19: note: token 2 has x-location == 5947
200 test.c:6:19: note: token 2 has y-location == 5414
202 cc1: note: token 3 has x-location == 0
203 cc1: note: token 3 has y-location == 2947526575
204 4: 2947526575, 2947526575
205 x-location == y-location == 2947526575 encodes token # 800042935
206 5: 2947526575, 2947526575
207 x-location == y-location == 2947526575 encodes token # 800042935
208 6: 2947526575, 2947526575
209 x-location == y-location == 2947526575 encodes token # 800042935
212 source_location interval: 2147483647 <= loc < 2147483648
215 source_location interval: 2147483648 <= loc < 4294967295
216 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^