This is the mail archive of the
mailing list for the GCC project.
infrastructure to detect whether code originates from macro expansion
- From: Robert Schiele <rschiele at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Cc: lopezibanez at gmail dot com
- Date: Tue, 26 Nov 2013 10:51:52 +0100
- Subject: infrastructure to detect whether code originates from macro expansion
- Authentication-results: sourceware.org; auth=none
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.
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 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.
Additionally I found that the mentioned
linemap_lookup/linemap_macro_expansion_map_p stuff seems to produce
useful information on the gcc 4.8 branch with the example from the bug
report but not on the gcc 4.7 branch. On the latter I actually don't
get the macro unwinding information. Thus it seems that this is not
the infrastructure Manuel was refering to.