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
* Zack Weinberg:
> On Thu, Jun 13, 2019 at 1:27 PM Joseph Myers <joseph@codesourcery.com> wrote:
>> On Thu, 13 Jun 2019, Zack Weinberg wrote:
>> > Ugh, you're right. I guess this really does need to be pushed from
>> > the compiler end. Do you think it would be worth filing a bug report
>> > on GCC and/or clang?
>>
>> I think it would make sense to stop defining by default any non-reserved
>> macros. But perhaps someone could investigate how widespread usage of
>> "#ifdef unix" or "#ifdef linux" is that would behave unexpectedly if those
>> stopped being defined (or likewise "#ifdef i386" etc.).
>
> Unfortunately codesearch.debian.net is not clever enough to do the
> necessary search;
> https://codesearch.debian.net/search?q=filetype%3Ac+%5Cblinux%5Cb for
> instance picks up dozens of instances of the word "linux" in comments,
> header names, string literals, etc. I don't myself have access to
> anything more powerful.
Try this:
<https://codesearch.debian.net/search?q=%5Cbdefined%5Cs*%5C%28%3Flinux>
Or this:
<https://codesearch.debian.net/search?q=%23%5Cs*ifdef%5Cs%2Blinux%5Cb>
This does not look good. Not at all.
It's like generating an error for implicit int or implicit function
declarations: very difficult to do.
Thanks,
Florian