|
|
|
|
|
by wahern
9 days 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. |
|
You have fuzzing, test coverage checks, overflow checks, static analysis, llm review. There is no conceivable reason why you might have a problem with using an u16 for a buffer length.
Even reading the PR comments shows that these libraries are just really low quality.
They are discussing if they should check the error return on callsites now that they made a function fallible.
Even a library like openssl using raw arithmetic operators all over the place is just weird imo. Every arithmetic operation should be checked version of the operation unless there is a provable performance hit. Languages should just not have operators