This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/81306] valgrind error for function warn_for_multistatement_macros in file c-warn.c line 2474
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Jul 2017 09:16:50 +0000
- Subject: [Bug c/81306] valgrind error for function warn_for_multistatement_macros in file c-warn.c line 2474
- Auto-submitted: auto-generated
- References: <bug-81306-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81306
--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
And I wonder if that's what this comment in dump_location_info talks about:
1187 for (unsigned int i = 0; i < MACRO_MAP_NUM_MACRO_TOKENS (map); i++)
1188 {
1189 source_location x = MACRO_MAP_LOCATIONS (map)[2 * i];
1190 source_location y = MACRO_MAP_LOCATIONS (map)[(2 * i) + 1];
1191
1192 /* linemap_add_macro_token encodes token numbers in an expansion
1193 by putting them after MAP_START_LOCATION. */
1194
1195 /* I'm typically seeing 4 uninitialized entries at the end of
1196 0xafafafaf.
1197 This appears to be due to macro.c:replace_args
1198 adding 2 extra args for padding tokens; presumably there may
1199 be a leading and/or trailing padding token injected,
1200 each for 2 more location slots.
1201 This would explain there being up to 4 source_locations slots
1202 that may be uninitialized. */