This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [glibc] <sys/stat.h>: Use Linux UAPI header for statx if available and useful


* Zack Weinberg:

> 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.

Yes, it's a known GCC bug:

  <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80005>

> 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).

Good point.  I had not thought of that.  We can keep it as a
function-like macro for the non-supported case.  I will send a patch for
that too.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]