News for hackers. Stuff that matters.
Re:The Ten Commandments for C Programmers (1987) by verall on Sunday May 24, 2020 @12:05PM (#23292440)
> If you pass a pointer-to-int instead, technically the behaviour is undefined.

But if you cast the intptr to voidptr, the behavior is defined, right? (Besides that %p is nonstandard iirc)

Re:The Ten Commandments for C Programmers (1987) by eMSF on Sunday May 24, 2020 @03:52PM (#23294191)
Yes. Also, %p isn't non-standard, however the conversion is implementation-defined.

(The reason why I used the word technically earlier was because on all common platforms int-pointers and void-pointers – and indeed all object pointers – have identical binary representation.)