[PATCH] D144889: [C2x] Support <string.h> in freestanding

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 27 15:48:27 PST 2023


rsmith added a comment.

Do we know what GCC intends to do about this C change? Per their documentation <https://gcc.gnu.org/onlinedocs/gcc/Standards.html>, they intend for GCC to be / eventually become a complete freestanding implementation without need for a separate libc:

> GCC aims towards being usable as a conforming freestanding implementation, or as the compiler for a conforming hosted implementation.
> GCC does not provide the library facilities required only of hosted implementations, nor **yet** all the facilities required by C99 of freestanding implementations on all platforms.

(Emphasis mine.) Likely because of GCC's perspective on this, the set of C headers provided by GCC, Clang, ICC, etc. has included the complete list of freestanding headers and more or less no others, with some libc implementations providing the full set and some providing just the non-freestanding ones. If we're moving away from that, we'll presumably need a new agreement between compiler folks and libc folks about which headers are provided by whom (and I expect it'll be "compilers provide what the C standard said before this change to freestanding and we pretend the change never happened").


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144889



More information about the cfe-commits mailing list