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

David Chisnall via cfe-dev cfe-dev at lists.llvm.org
Thu Jul 13 09:18:00 PDT 2017


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.

David




More information about the cfe-dev mailing list