This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [hurd,commited] hurd: do not check Mach and Hurd headers
On Sat, 3 Mar 2018, Samuel Thibault wrote:
> Well hurd & mach headers are not meant to be used without _GNU_SOURCE=1,
> for a start... Usual applications wouldn't use them anyway, only things
If a header requires some type T, I'd expect it to include bits/types/T.h,
thereby ensuring that type T is defined regardless of feature test macros,
instead of including some other header that might or might not define type
T depending on feature test macros.
Likewise for any other dependencies on features from other headers. (And
of course these headers shouldn't themselves contain feature test macro
conditionals.)
> like e.g. libparted, Xorg, etc. which need to interact closely with
> system things use them, and thus have to enable the GNU extensions. You
> can think of them like linux/ headers.
Well, all linux/*.h and asm/*h headers also ought to be includable in
isolation, with any feature test macros defined. But that's the Linux
kernel's problem, not ours, since it's the Linux kernel that provides
those headers. Whereas this test is purely for headers installed by
glibc. And every header installed by glibc should either work in
isolation, or if it's not meant to work in some context should have a
#error explaining the issue - like the #errors in bits/*.h headers saying
not to include them directly, or the #error in sys/elf.h for x86_64
GNU/Linux, for example.
I think it's dubious to have a #error requiring _GNU_SOURCE to be used,
because it should always be possible to write a header in a way that
doesn't have such a requirement. But in any case where, after analysis,
such a #error is found to make sense (and a comment goes on the #error
explaining why it makes sense), that specific header might have testing
disabled in check-installed-headers.sh *only* when _GNU_SOURCE is not
passed - not for other feature test macros, not using wildcards like
hurd/*.h.
--
Joseph S. Myers
joseph@codesourcery.com