3 ms·
Not applicable to C -- "Currently only supported by the Java and Fortran front ends." https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Code-Gen-Options.html#Code-G
by rst 12y ago
Not applicable to C -- "Currently only supported by the Java and Fortran front ends."
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Code-Gen-Options.html#Code-Gen-Options https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Code-Gen-Option...
There have been bounds-checked implementations of C, but the runtime cost is very large. The problem is that to do it, you need to check not only explicit array references, but pointer dereferences as well -- and in order to make that work, each pointer needs to carry around with it its associated bounds. That, in turn, means that your pointer representation has to be something more (or other) than just a plain machine address.