-preview=safer for D

Walter Bright newshound2 at digitalmars.com
Mon Dec 16 18:32:51 UTC 2024


On 12/16/2024 9:16 AM, Lance Bachmeier wrote:
> But that's only a benefit if the optimization matters. For most of what I do, it 
> doesn't. If you use the GC for your D code but interact with C libraries, you 
> have the PITA of the compiler saying something's not memory safe, but 100% of 
> the time spent getting it to compile is memory safety theater.

Whenever I review C code, I look for strncpy calls. It's nearly always buggy. 
Using the GC with it won't help.

In my revisions of old code to use safe practices, it has resulted in more 
understandable code. The only slowdown was the use of array bounds checking 
(using the GC won't help with that, either).


More information about the Digitalmars-d mailing list