| ▲ | wahern 2 hours ago | |||||||
Not everybody recommends size_t. There's a sizeable community of people absolutely convinced most integers, including length and capacity integers, should be signed. And they stick to their guns even for C and C++. They have some very compelling logical arguments on their side, but IMO in languages like C and C++ they're just fatally unrealistic. | ||||||||
| ▲ | jurf 4 minutes ago | parent | next [-] | |||||||
ssize_t | ||||||||
| ▲ | uecker 2 hours ago | parent | prev [-] | |||||||
Why unrealistic? I was in the unsigned camp a long time ago and switched to signed types for indexing and sizes, and this made many problems go a way. There was just a nginx issue that highlights how problematic the use of unsigned is in this context: CVE -2026-123007 | ||||||||
| ||||||||