[llvm-bugs] [Bug 45613] New: Missing definition for __STDC_ISO_10646__

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Apr 19 19:06:48 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=45613

            Bug ID: 45613
           Summary: Missing definition for __STDC_ISO_10646__
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: joe at begriffs.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

The C99 standard says that the environment should define symbol
__STDC_ISO_10646__ when wchar_t can hold all Unicode codepoints. The specific
language is:

Section 6.10.8, Predefined macro names:
> __STDC_ISO_10646__
> An integer constant of the form yyyymmL (for example, 199712L).
> 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. The
> Unicode required set consists of all the characters that are
> defined by ISO/IEC 10646, along with all amendments and
> technical corrigenda, as of the specified year and month.

Clang on macOS and OpenBSD does not define this symbol, while clang on Ubuntu
does.

I created a test program at https://github.com/begriffs/wchar-conformance which
sends UTF-8 encodings of all codepoints through mbstowcs() and checks whether
the wchar_t* holds the expected values. On all three platforms (macOS, OpenBSD,
Ubuntu) the test program was successful. Unless I misunderstood the standard,
clang on macOS and OpenBSD should define the symbol, but they haven't.

Version specifics:

----------------------------------------------------
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
----------------------------------------------------
OpenBSD clang version 8.0.1 (tags/RELEASE_801/final)
                            (based on LLVM 8.0.1)
Target: amd64-unknown-openbsd6.6
----------------------------------------------------
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
(__STDC_ISO_10646__ is 201706)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200420/237038bd/attachment.html>


More information about the llvm-bugs mailing list