<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - WCHAR_MAX and WCHAR_MIN may sometimes have the wrong types"
href="https://bugs.llvm.org/show_bug.cgi?id=32833">32833</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>WCHAR_MAX and WCHAR_MIN may sometimes have the wrong types
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Headers
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dexonsmith@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>