Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Jan 2025 13:40:26 +0000
From:      bugzilla-noreply@freebsd.org
To:        standards@FreeBSD.org
Subject:   [Bug 283917] libc failes to include stdint.h with clang>16 and -ffreestanding
Message-ID:  <bug-283917-99-EJfqBiqRKh@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-283917-99@https.bugs.freebsd.org/bugzilla/>
References:  <bug-283917-99@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D283917

--- Comment #2 from keve@keve.hu ---
Hi Konstantin,=20
thank you for looking at this.
I tend to read it differently:


The ISO C standard defines (in clause 4) two classes of conforming
implementation. A conforming hosted implementation supports the whole stand=
ard
including all the library facilities; a conforming freestanding implementat=
ion
is only required to provide certain library facilities: those in <float.h>,
<limits.h>, <stdarg.h>, and <stddef.h>; since AMD1, also those in <iso646.h=
>;
since C99, also those in <stdbool.h> and <stdint.h>; and since C11, also th=
ose
in <stdalign.h> and <stdnoreturn.h>. In addition, complex types, added in C=
99,
are not required for freestanding implementations.

So since C99 it is ok to assume presence of and include stdint.h even with
-ffreestanding.
Clang starting with 17 implements C99.

Also the standard says that a freestanding implementation _may_ not impleme=
nt
these headers, it does not say anything about it _must_ not implement them.

Btw. just confirmed that  NetBSD 10.1 can compile this as well.

-nostdinc is unfortunately not a viable workaround.

Please reconsider your assessment whether this is an issue with FreeBSD lib=
c,
or not.

Thank you!

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-283917-99-EJfqBiqRKh>