https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129

--- Comment #11 from Maxim Cournoyer <maxim.cournoyer at gmail dot com> ---
(In reply to Jonathan Wakely from comment #10)
> (In reply to Maxim Cournoyer from comment #9)
> > About not using it: sure, this works, but now how can a project enable
> > warnings just for their own headers and not those of the whole system?  This
> > seems to be a valid use case.
> 
> This works, but is tedious to do for every warning:
> 
> #pragma GCC diagnostic push
> #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
> #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
> #include <third-party-library/header.h>
> #pragma GCC diagnostic pop

Thanks for the trick.  Agreed that it is tedious, but still good to know. 
About my previous comment saying that the workaround of not including any GCC
standard include directory in -isystem (or CPLUS_INCLUDE_PATH), the problem was
that I had set CPLUS_INCLUDE_PATH but not C_INCLUDE_PATH, and Inkscape goes on
to build bundled libraries which are C, not C++.  Hence, the Linux kernel
headers really were not present in any include search path for a C program. 
Apologies for the noise.

Reply via email to