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

On the contrary! Unsigned types are the only ones in C were everything is sanely defined, they are the integers mod 2^n. Signed types have undefined behaviour on overflow in C. In-band signalling of error states is error-prone. It is unfortunately commonly done in C because you can't return multiple values and passing in pointers is uglier.


> and passing in pointers is uglier

It's not so bad. It means you can be really consistent about returning error codes from every function in the exact same way. This is one of the very few things I actually like about the Win32 API. If only they used the same type of error codes in every section of the API.




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

Search: