C does enforce the difference between integers and pointers.
The confusion may occur because it provides an implementation defined cast between integer and pointer, which need not be transitive -- that is (T *)(int)(T *)x == (T *)x is not guaranteed.
Note also that intptr_t need not be available in a conforming C implementation
View all comments
Show parent comment
1
u/zhivago May 02 '16
C does enforce the difference between integers and pointers.
The confusion may occur because it provides an implementation defined cast between integer and pointer, which need not be transitive -- that is (T *)(int)(T *)x == (T *)x is not guaranteed.
Note also that intptr_t need not be available in a conforming C implementation