stdc_bit_ceil(3) and wrapping

Alejandro Colomar alx.manpages@gmail.com
Fri Dec 30 21:01:35 GMT 2022


On 12/30/22 21:56, Joseph Myers wrote:
> On Fri, 30 Dec 2022, Alejandro Colomar via Gcc wrote:
> 
>> For the C standard, shifts have wrap around semantics for unsigned types:
> 
> Only if the shift count is nonnegative and strictly less than the width of
> the type.  This is about shifting by an amount equal to the width of the
> type, which has undefined behavior.

Ahhh, right, I forgot that detail.  Yep, I need to special-case then.

Thanks!



-- 
<http://www.alejandro-colomar.es/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20221230/80cf781e/attachment.sig>


More information about the Libc-alpha mailing list