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

Compiler vendors have been resistant towards putting in such features. Bounds checking slows things down, and the performance race is very much a thing in C compiler implementations -- a compiler that can deliver a few percentage points better code can be a big win to teams working on compute heavy problems. C11 has Annex K which has a lot of safety features, like memory safe arrays. Unfortunately, none of the vendors have implemented it even as an option. Which is a shame because it would solve a lot of problems, with requiring minimal rewrites for a lot of code.


Annex K was required in C99 and made optional in C11, it tells everything on how C vendors see safety.

Also it is actually a joke, since it still separates the pointers and length in two separate variables, instead of using some kind of struct.

The only thing it does is have functions with better semantics on the terminating nulls.




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

Search: