[PATCH] D86993: Document Clang's expectations of the C standard library.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 5 05:49:45 PDT 2023


aaron.ballman added a comment.

In D86993#4471912 <https://reviews.llvm.org/D86993#4471912>, @RalfJung wrote:

> What is the status of this patch? It has not been committed as far as I can tell.

Correct, it's not been committed yet. we're still discussing (though that's obviously stalled out a bit).

> I was looking into this coming from Rust, where we do worry a bit about LLVM calling `memcpy`, `memmove` or `memset` in ways that are not allowed by the C standard. This here would at least give us something to point to, though it doesn't answer the question "which C standard libraries have officially committed to guaranteeing these properties". Since this affects all compilers using LLVM, not just Clang, should this be put somewhere in the LLVM docs?

I think it makes sense to document this both from the Clang perspective and from the LLVM perspective, as they're somewhat different. Clang strives to be a conforming C and C++ implementation, so our conformance requirements are different than LLVM, which aims to be a backend for more general use than just C and C++. For example, Clang needs to talk about freestanding and that's not really something LLVM needs to talk about as such.

I continue to think it's a mistake for us to document that Clang will not work with a conforming C standard library implementation unless we're filing issues with WG14 to alert them to the reasons why. If there's a DR filed with the committee, that gives us something to point our users to as justification. Otherwise, our users will correctly put these bugs at our feet.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86993/new/

https://reviews.llvm.org/D86993



More information about the cfe-commits mailing list