[llvm-bugs] [Bug 32833] New: WCHAR_MAX and WCHAR_MIN may sometimes have the wrong types

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 27 16:17:01 PDT 2017


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

            Bug ID: 32833
           Summary: WCHAR_MAX and WCHAR_MIN may sometimes have the wrong
                    types
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Headers
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dexonsmith at apple.com
                CC: llvm-bugs at lists.llvm.org

I fix the definitions of size_t, ptrdiff_t, uintptr_t, intptr_t, uintmax_t, and
intmax_t, and the associated MAX and MIN macros, in r301593.  However, I didn't
look at wchar_t, WCHAR_MAX, and WCHAR_MIN.

We should:
- Set wchar_t to __WCHAR_TYPE__.
- Set WCHAR_MAX to __WCHAR_MAX__.
- Set WCHAR_MIN to -__WCHAR_MAX__-1 when wchar_t is signed.
- Set WCHAR_MIN to 0*__WCHAR_MAX when wchar_t is unsigned.

I'm not sure how to manage the last two; filing a PR to track this.

Note that the rank of wchar_t is likely <= int on all the platforms we support,
so any problem may be unobservable right now.

-- 
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/20170427/c36328b9/attachment.html>


More information about the llvm-bugs mailing list