Hello Robert, Robert Schiele <rschi...@gmail.com> a écrit:
> in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48778 Manuel > López-Ibáñez mentioned that starting with gcc 4.7 there is supposed to > be infrastructure to figure out for diagnostics whether the location > of an error was created by macro expansion and that this can be used > to disable a warning in that case. Indeed. > Can anyone point me to the name of a function/macro I should use to > check that or another example in the code that already does this? I think you want to use the function linemap_location_from_macro_expansion_p() from libcpp/line-map.c. The pointer to struct line_maps set you pass is usually the global variable named 'line_table'. > I mean I can see how maybe_unwind_expanded_macro_loc figures out > whether it needs to unwind macro expansions but I am not sure whether > this linemap_lookup/linemap_macro_expansion_map_p stuff is what I am > supposed to use in the place where I check for the diagnostics to emit > or whether there is a higher level abstraction of this functionality. You are right, linemap_macro_expansion_map_p is a tad lower level than what you want. I hope this helps. Cheers. -- Dodji