PR 91770 - emit a warning in a system header
Jakub Jelinek
jakub@redhat.com
Thu Oct 10 13:06:00 GMT 2019
On Thu, Oct 10, 2019 at 08:24:29AM -0400, Nathan Sidwell wrote:
> In addressing 91770, I need to emit a warning for a location inside a system
> header file[1]. The diagnostics machinery elides warnings when the location
> is in a system header :(
>
> As I happen to have located the appropriate line_map in the process of
> determining the nested extern "C", I could clear the map's in-system-header
> flag around the warning emission. But that's, well, urgh:(
>
> Is there a neater way?
bool save_warn_system_headers = global_dc->dc_warn_system_headers;
global_dc->dc_warn_system_headers = 1;
...
global_dc->dc_warn_system_headers = save_warn_system_headers;
?
I'm afraid warning_sentinel can't be used here, because that clears, rather
than sets it.
Jakub
More information about the Gcc-patches
mailing list