[libc++] PR25118: move include_next after #pragma system_header

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 8 17:25:25 PDT 2015


The patch LGTM.  However I would rather see the pragma in <stddef.h>
wrap itself in the `#if !defined(_LIBPP_HAS_NO_SYSTEM_HEADER_PRAGMA)`.
I agree that we probably
shouldn't include "<__config>". However people are still free to add
the definition to the command line (line libc++ does when building and
testing).

/Eric

On Thu, Oct 8, 2015 at 5:36 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> Hi,
>
> As noted in PR25118, people who include libc++'s headers via a -I path with
> -pedantic_errors will see errors due to the use of #include_next. This patch
> moves the #include_next after the #pragma system_header line to suppress the
> error.
>
> (For the __need_* case in <stddef.h>, I'm not checking whether pragma
> system_header is available: these macros should only be defined for systems
> where the pragma is available, and it doesn't seem like a good idea to
> include <__config> in this case.)


More information about the cfe-commits mailing list