<div dir="ltr"><div>C says that plain bit-fields could be either signed or unsigned. C++ removed this allowance in core issue 739:</div><div><br></div><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#739">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#739</a><br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Nov 16, 2013 at 1:55 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013 Nov 15, at 19:41, Mark Lacey <<a href="mailto:mark.lacey@apple.com">mark.lacey@apple.com</a>> wrote:<br>

<br>
> I don’t have the C/C++ standards in front of me but IIRC whether a char/short/int/long/long long bitfield is signed or unsigned is implementation defined. You need to explicitly specify signed or unsigned in order to have any guarantee of the signedness, e.g. signed int.<br>

<br>
</div>Section 3.9.1 of the C++11 standard [1] defines short/int/long/long long as signed.  Bit-fields are discussed in 9.6 and have lots of implementation-defined behavior, but I don’t see anything about signedness.  The ABI (e.g., [2]) defines whether char is signed or unsigned.<br>

<br>
[1]: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3485.pdf" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3485.pdf</a><br>
[2]: <a href="http://www.cs.tufts.edu/comp/40/readings/amd64-abi.pdf" target="_blank">http://www.cs.tufts.edu/comp/40/readings/amd64-abi.pdf</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>