On 11/1/2014 11:13 PM, "Ola Fosheim Grøstad" <ola.fosheim.grostad+dl...@gmail.com>" wrote:
On Sunday, 2 November 2014 at 01:43:32 UTC, Walter Bright wrote:
There are bounds-checking extensions to GCC.

Yup, -fbounds-check, and it only works for local arrays. Once the array is
passed to a function, poof! no more bounds checking.

No.

Please read the links.

There are solutions that do full checking by checking every pointer access at
runtime. And there are other solutions.

Yeah, I looked at them. For example, http://www3.imperial.ac.uk/pls/portallive/docs/1/18619746.PDF has the money quote:

"The ’A’ series, which is a group of classic artificial benchmarks, and the ’B’ series, which is a selection of CPU-intensive real-world code, performed particularly poorly, ranging from several hundred to several thousand times slower."

This is not a solution. C has successfully resisted all attempts to add bounds checking.

Reply via email to