Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Casting pointers is well defined. What is undefined behavior is to dereference a pointer whose type does not match the pointed-to object.


That's not correct in general; casting pointers is possibly undefined. However, it does seem a made a mistake trying to use void * as an example.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: