[cfe-dev] -pedantic warnings in system headers?

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Fri Jul 14 11:13:09 PDT 2017


On Thu, Jul 13, 2017 at 9:18 AM David Chisnall via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On 13 Jul 2017, at 17:07, Stephan Bergmann via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
> >
> > From a quick look at the code of both GCC and Clang, I assume the
> difference is due to GCC implicitly assuming /usr/include/assert.h to be a
> system header (so it suppresses the pedantic warning there), while Clang
> does not.  (Curiously, while many of the libstdc++ files in
> /usr/include/c++/... have
>
> I believe that this is a known issue, where the warning suppression for
> macros happens based on the instantiation location, not on the declaration
> location.  You are getting the warning because the file in which you
> instantiate the macro is not a system header, even though the macro is
> defined in a system header.
>

Not always the case - Clang looks at where a macro is defined in many
cases, I think - though I could be wrong. Maybe this one hasn't been
adjusted yet.


>
> David
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170714/648503f2/attachment.html>


More information about the cfe-dev mailing list