[libcxx-commits] [PATCH] D130946: [libc++][cuchar] Declare std::c8rtomb and std::mbrtoc8 in <cuchar> if available.

Tom Honermann via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Sep 10 07:13:25 PDT 2022


tahonermann added a comment.

> Let's go with this.

Thank you! I'll proceed with landing the changes as-is.

> I'd normally fight against the _LIBCPP_HAS_NO_C8RTOMB_MBRTOC8, but in this case that will preclude libc++ from being usable on GCC with essentially all version of glibc, since c8rtomb was added to it less than a month ago.

Understood. Note that this same issue will arise if/when Microsoft adds support for these functions to their C library implementation. Unless I'm mistaken, Microsoft doesn't offer a `__attribute__((__using_if_exists__))` equivalent for Visual C++.

> But just for the record, our normal policy is that compilers that don't support using_if_exists are only supported on platforms that implement a full C standard library, which would mean (if taken at the letter) that GCC isn't supported on Glibc < 2.36. In practice, let's make this work, but we're not going to start adding carve-outs for ancient C libraries (that's what I want to avoid by giving this rationale).

Understood. It might be worth establishing a support policy for various C library implementations. If, for example, libc++ only promised support for glibc versions less than 4 years old, then we could remove the `_LIBCPP_HAS_NO_C8RTOMB_MBRTOC8` and related conditionals in 4 years (subject to use with other C libraries).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130946



More information about the libcxx-commits mailing list