DIP1028 - Rationale for accepting as is

Walter Bright newshound2 at digitalmars.com
Fri May 22 05:37:55 UTC 2020


On 5/21/2020 8:36 PM, Paul Backus wrote:
> Something ought to be done to prevent this. It doesn't have to be the exact
> proposal from the discussion thread, but doing nothing and allowing widespread
> silent breakage cannot possibly be the best solution.

I can see that happening. A simple example would be:

     extern (C) void free(void* p);
     ...
     free(p);
     free(p);

The thing is, you are no worse off than now. If free() can be misused by calling 
it from system code, it can be misused by calling it from safe code.

There's no way the compiler can detect this. If you annotate it, you'll just 
have to annotate it correctly. Forcing an annotation just means slapping @safe: 
at the beginning of the file and moving on - it's not going to help.


More information about the Digitalmars-d-announce mailing list