[RFC v2 1/3] cdefs: Add __bool

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Sep 2 15:27:31 GMT 2025


Hi,

>> This seems entirely possible, given the glibc documentation requires
>> GCC 12.1 at least.
>> <https://sourceware.org/glibc/manual/latest/html_node/Tools-for-Compilation.html>
>
> That's about building glibc itself, but <sys/cdefs.h> is an installed
> header which must support arbitrary compilers.

We still need to define "arbitrary" here. In [1] I asked a while back:

On a related note, we still have various __GNU_PREREQ (2, 4) in our headers.
Does anyone ever test such ancient compilers/binutils still work with GLIBC?
At which point do we consider them obsolete? Would it be reasonable to also
set a minimum version here which trails the minimum GLIBC build compiler by
say 5 years?

So if we could set minimum GCC version to use headers to GCC 7, we'd be able
to get rid of a whole lot of clutter:

> grep  "__GNUC_PREREQ\s*([1-7]" -R * | wc
1467

That's 5000+ lines of #ifdef/else/endif alone.

Cheers,
Wilco

[1] https://sourceware.org/pipermail/libc-alpha/2024-October/160713.html


More information about the Libc-alpha mailing list