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

You could return a pointer or null. That would successfully force the "did it succeed" check, but of course raises questions about memory management.

Tagged union is probably the best approach. It doesn't prevent skipping the check, but it at least makes "thing I am supposed to use" different than "thing I am supposed to check".



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: