This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [glibc] <sys/stat.h>: Use Linux UAPI header for statx if available and useful
On Wed, Jun 12, 2019 at 11:21 AM Zack Weinberg <zackw@panix.com> wrote:
> On Wed, Jun 12, 2019 at 10:16 AM Florian Weimer <fweimer@redhat.com> wrote:
> > > +#if __glibc_has_include (<linux/stat.h>)
> ...
> >
> > It turns out that this does not work as expected in some configurations
> > because linux is a macro, defined to 1, and it's expanded in this
> > context
>
> I wonder how much stuff still depends on these legacy user-namespace
> OS-specific macros.
Additionally, I think this is a bug in GCC. It should apply the
special rules for tokenization of an #include argument to the argument
of __has_include: < should begin a header-name, not be treated as a
punctuator. We would still have an issue with __glibc_has_include
being a function-like macro, therefore its argument would get
tokenized and expanded first and the normal rules would still apply,
but we could fix that by making it an object-like macro instead (only
when __has_include is available).
zw