Maybe D is right about GC after all !

codephantom me at noyb.com
Tue Dec 26 07:01:16 UTC 2017


On Tuesday, 26 December 2017 at 04:47:35 UTC, Walter Bright wrote:
>
> Only if someone considers this as fixed:
>
>     int foo(int* p) { return p[1]; }
>     int bar(int i) { return foo(&i); }
>
>     clang++ -c test.cpp -Wall
>
>

good example..and it makes a good point.

however, let that point be not that C/C++ is flawed (since 
pointers are meant to let you point to anywhere), but rather that 
the code example is flawed.

there is a difference between a flawed language, and flawed use 
of that language.

e.g. what if I accidently left out the @safe attribute on those 
functions in D?



More information about the Digitalmars-d mailing list