[PATCH] D106577: [clang] Define __STDC_ISO_10646__

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 22 12:49:58 PDT 2021


cor3ntin added a comment.

In D106577#2897588 <https://reviews.llvm.org/D106577#2897588>, @aaron.ballman wrote:

> In D106577#2897522 <https://reviews.llvm.org/D106577#2897522>, @jyknight wrote:
>
>> I'm not sure we should be populating this.
>>
>> The _value_ is determined by what libc supports, so it probably needs to be left up to libc to define it.
>
> Why is the value determined by what libc supports? The definition from the standard is:
>
>   If this symbol is defined, then every character in the Unicode required set, when stored in an
>   object of type wchar_t, has the same value as the short identifier of that character.
>
> That doesn't seem to imply anything about the library, just the size of `wchar_t`.

That's my reading as well.
This is only about representability, not about what the locale features can handle (if anything).
In particular, setting it only on linux would be less than useful. 
The primary use of this macro is to detect environments where wchar_t is not UTF-32, namely windows and IBM platforms.
So this should be defined on all relevant platforms, not just the ones which use glibc

Note that this patch came about because someone had trouble with that macro not being present on mac.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106577



More information about the cfe-commits mailing list