RFC: Change what assert does on error

kdevel kdevel at vogtner.de
Wed Jul 2 16:51:40 UTC 2025


On Wednesday, 2 July 2025 at 08:11:44 UTC, Walter Bright wrote:
> On 6/30/2025 2:18 PM, Sebastiaan Koppe wrote:
>> Just know that the idea of exiting directly when something 
>> asserts on the pretense that continueing makes things worse 
>> breaks down in multi-threaded programs.
>
> An assert tripping means that you've got a bug in the program, 
> and the program has entered an unanticipated, unknown state.

This program

    void main ()
    {
       assert (false);
    }

is a valid D program which is free of bugs and without any
"unanticipated, unknown" state.

Do you agree?


More information about the Digitalmars-d mailing list