More evidence that memory safety is the future for programming languages

Walter Bright newshound2 at digitalmars.com
Wed Apr 1 21:44:27 UTC 2020


On 4/1/2020 12:03 PM, Johan wrote:
> I meant static analysis.

I'm not familiar specifically with clang's static analysis, but my experience 
with such is they detect a few obvious patterns, and miss the subtle ones that 
cause all the trouble. For example,

     int* foo(int i) { return &i; }

gets detected by static analysis. This one does not:

     int* bar(int* p) { return p; }

     int* foo(int i) { return bar(&i); }

The idea with D is to solve it in the general case, not by matching specific 
patterns. #Dip1000 is how D solves the second case in general.


More information about the Digitalmars-d mailing list