[PATCH] Add example to rand.3

Alejandro Colomar alx.manpages@gmail.com
Fri Dec 30 18:58:43 GMT 2022


Hi Joseph,

On 12/30/22 19:50, Joseph Myers wrote:
> On Fri, 30 Dec 2022, Alejandro Colomar via Libc-alpha wrote:
> 
>>> I expect to implement these functions in due course for glibc (not GCC,
>>> since these are library functions, with the usual requirements for
>>> definitions with external linkage, though most would also have inline
>>> header implementations based on existing longstanding built-in functions).
>>
>> Is there any builtin for stdc_bit_ceil()?  I've tried to search for it, but
>> didn't find it.  I came to the conclusion that I need to write the ugly code
>> around __builtin_clz().
> 
> I don't think there's such a built-in function, so yes, the inline
> function would need to use __builtin_clz.  (Even the stdc_leading_zeros
> inline functions will need to do more than just call __builtin_clz - they
> need to check for zero, since the standard functions have a defined result
> for a zero argument whereas __builtin_clz doesn't.)

Thanks for confirming.  That was my guess :|

Cheers,

Alex

> 

-- 
<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/c52bdcff/attachment.sig>


More information about the Libc-alpha mailing list