Undefined behaviours in D and C

Fawzi Mohamed fawzi at gmx.ch
Mon Apr 19 05:19:11 PDT 2010


On 19-apr-10, at 12:32, bearophile wrote:

>> In the stdint.h of C99 there is (optionally) uintptr_t that's is an  
>> unsigned int that is large enough to contain a pointer (there is a  
>> intptr_t too, signed). In C99 you use that to convert a pointer to  
>> an integral.
>>
>> I don't know if D specs assert that D size_t is wide enough to  
>> represent a pointer.
>
> There's uintptr_t in D std lib too, I have to start using it:
> http://www.digitalmars.com/d/2.0/phobos/std_stdint.html

that is for C compatibility, D has always defined size_t and ptrdiff_t  
(without needing to import anything) exactly like that.




More information about the Digitalmars-d mailing list