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 location_t value means. Source code
24 lines are quoted, showing both per-line location_t values and
25 per-line&column location_t values (written vertically under the
26 corresponding character of source code).
28 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
30 location_t interval: 0 <= loc < 2
33 location_t interval: 32 <= loc < 64
38 test.c: 1|loc: 32|#include "test.h"
43 location_t interval: 64 <= loc < 96
50 location_t interval: 96 <= loc < 128
57 location_t interval: 128 <= loc < 160128
58 file: /usr/include/stdc-predef.h
62 (contents of /usr/include/stdc-predef.h snipped for brevity)
65 location_t interval: 160128 <= loc < 160160
72 location_t interval: 160160 <= loc < 164256
77 test.c: 1|loc:160160|#include "test.h"
84 location_t interval: 164256 <= loc < 173280
89 test.h: 1|loc:164256|extern int foo ();
99 test.h: 3|loc:172448|#define PLUS(A, B) A + B
100 |222222222222222223333333
101 |455566677788889990001112
102 |814704703603692692582581
103 |024680246802468024680246
106 location_t interval: 173280 <= loc < 202016
111 test.c: 2|loc:173280|
116 test.c: 3|loc:177376|int
121 test.c: 4|loc:181472|main (int argc, char **argv)
122 |1111111111111111222222222222
123 |5556666777888999000111222333
124 |0360369269258258148147047036
125 |4680246802468024680246802468
126 test.c: 5|loc:185568|{
131 test.c: 6|loc:189664| int a = PLUS (1,2);
132 |999999999900000000000
133 |677788899900011122233
134 |926925825814814704703
135 |680246802468024680246
136 test.c: 7|loc:193760| int b = PLUS (3,4);
137 |333333344444444444444
138 |788899900011122233344
139 |925825814814704703603
140 |246802468024680246802
141 test.c: 8|loc:197856| return 0;
146 test.c: 9|loc:201952|}
152 UNALLOCATED LOCATIONS
153 location_t interval: 202016 <= loc < 2147483633
155 MACRO 1: PLUS (7 tokens)
156 location_t interval: 2147483633 <= loc < 2147483640
157 test.c:7:11: note: expansion point is location 194115
161 map->start_location: 2147483633
164 test.c:7:17: note: token 0 has x-location == 194304
168 test.c:7:17: note: token 0 has y-location == 173088
170 In file included from test.c:1:0:
171 test.h:3:22: note: token 1 has x-location == y-location == 173152
172 #define PLUS(A, B) A + B
176 test.c:7:19: note: token 2 has x-location == 194368
180 test.c:7:19: note: token 2 has y-location == 173216
182 cc1: note: token 3 has x-location == 0
183 cc1: note: token 3 has y-location == 2947526575
184 4: 2947526575, 2947526575
185 x-location == y-location == 2947526575 encodes token # 800042942
186 5: 2947526575, 2947526575
187 x-location == y-location == 2947526575 encodes token # 800042942
188 6: 2947526575, 2947526575
189 x-location == y-location == 2947526575 encodes token # 800042942
191 MACRO 0: PLUS (7 tokens)
192 location_t interval: 2147483640 <= loc < 2147483647
193 test.c:6:11: note: expansion point is location 190019
197 map->start_location: 2147483640
200 test.c:6:17: note: token 0 has x-location == 190208
204 test.c:6:17: note: token 0 has y-location == 173088
206 In file included from test.c:1:0:
207 test.h:3:22: note: token 1 has x-location == y-location == 173152
208 #define PLUS(A, B) A + B
212 test.c:6:19: note: token 2 has x-location == 190272
216 test.c:6:19: note: token 2 has y-location == 173216
218 cc1: note: token 3 has x-location == 0
219 cc1: note: token 3 has y-location == 2947526575
220 4: 2947526575, 2947526575
221 x-location == y-location == 2947526575 encodes token # 800042935
222 5: 2947526575, 2947526575
223 x-location == y-location == 2947526575 encodes token # 800042935
224 6: 2947526575, 2947526575
225 x-location == y-location == 2947526575 encodes token # 800042935
228 location_t interval: 2147483647 <= loc < 2147483648
231 location_t interval: 2147483648 <= loc < 4294967295
232 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^