News for hackers. Stuff that matters.
Re:A New Development for Coverity and Heartbleed by im3w1l on Saturday April 12, 2014 @05:58PM (#7579356)
>runtime bounds check

The reason people use c, is to get higher speed by avoiding those kinds of checks. A real solution most avoid slowdowns.

Re:A New Development for Coverity and Heartbleed by pjmlp on Sunday April 13, 2014 @02:20AM (#7580451)
If the reason was to avoid those checks, then people really don't know better.

Turbo Pascal => {$R-}

Ada => pragma Suppress (Index_Check);

Modula-3 => cm3 -A

D => dmd -fnoboundscheck / array.ptr[index] in @system code

Just a few examples. Additionally there are lots of research how to remove bounds checking in compiler optimizations

http://citeseer.uark.edu:8080/citeseerx/showciting;jsessioni...

What C has going for it is the symbiotic relationship with UNIX, 40 years of optimizations in most compilers and the historical baggage of being around for so long.

Other better languages suffered from having been shown the door as UNIX spread into the enterprise, but there was a time when C compilers didn't generate better code as the other ones.

Re:A New Development for Coverity and Heartbleed by marshray on Saturday April 12, 2014 @09:33PM (#7579826)
You can encode the length of an array in the type in C++, at compile time.