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

> If a variable deserves the name `size` it deserves the type `size_t` as well.

That would be a mistake since size_t is poorly designed - it’s unsigned and you should use signed integer types whenever possible in C, as the Google C++ style guide says.

This is more secure because UBSan is more likely to find bugs using it. Bit unfortunate the STL doesn’t like you doing it.



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

Search: