<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - UINT16_TYPE and INT16_TYPE are defined as short instead of int for AVR"
href="https://llvm.org/bugs/show_bug.cgi?id=31530">31530</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>UINT16_TYPE and INT16_TYPE are defined as short instead of int for AVR
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dylanmckay34@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>UINT16_TYPE and INT16_TYPE are implicitly defined by the preprocessor
to the short type, rather than int. While shorts and ints are both
16 bits wide on the avr, gcc picks ints to represent 16 bits wherever
possible, and picking short can cause issues with C++ name mangling
(see <a href="https://reviews.llvm.org/D27123#615854">https://reviews.llvm.org/D27123#615854</a>). Therefore, clang should
define the two types to short.
Clang's lib/Frontend/InitPreprocessor.cpp::DefineExactWidthIntType does not
use TargetInfo::getIntTypeByWidth. Instead,
InitializePredefinedMacros calls
the function with the specific type (SignedShort/UnsignedShort), because
getShortWidth() > getCharWidth(), but getIntWidth() ==
getShortWidth().</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>