[libc-commits] [libc] [libc] Provide an implementation of the 'stdint.h' header (PR #83353)

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Wed Feb 28 15:38:34 PST 2024


jhuber6 wrote:

> We probably need to be careful with this change. I'm nervous if stdint.h from clang is 100% the same for different architectures?
>
This is the same handling clang uses for all its targets, if you do `-ffreestanding` on your target you'll get this implementation so it's expected to work for all architectures clang supports I'd say.

> I do worry about `#include_next` as I highly suspect it's behavior is non-deterministic in the face of `-I` (or perhaps `-isystem`) flags.

This does not use the `include_next` part, that's handled in clang.
> If we did do this change, I think we could+should replace our `#include <stdint.h>` with including our stdint.h.
> 
> ```shell
> $ grep -rn '<stdint' libc | wc -l
> 208
> ```

If we replaced this it would have equivalent behavior to compiling with `clang -ffreestanding`.

https://github.com/llvm/llvm-project/pull/83353


More information about the libc-commits mailing list