> For array bounds checking, if you want it, just a write a structure with buffer length and a getter setter and it is done.
It's so easy, yet buffer overflows remain the #1 problem in shipped C code.
> For all small strings that just locally it serves its purpose nicely.
Not really. Whenever I review other peoples' C code, I look at their use of strlen/strncpy/strxxx functions. They're a rich source of bugs, and I'll usually find one in it (usually an off-by-one error). They don't have to be large strings, either, to be slow.
It's so easy, yet buffer overflows remain the #1 problem in shipped C code.
> For all small strings that just locally it serves its purpose nicely.
Not really. Whenever I review other peoples' C code, I look at their use of strlen/strncpy/strxxx functions. They're a rich source of bugs, and I'll usually find one in it (usually an off-by-one error). They don't have to be large strings, either, to be slow.