Right now betterC automatically sets the assertion behavior to calling C's _assert.
This has some problems:
- one can't differentiate between different error type (assert, array bounds check failure, final switch failure)
- _assert has parameters of type "char*" but the message is not zero terminated, if it is not a static string.
I propose to be able to use the -checkaction=D compiler option to indicate that the existing handler functions _d_assert, _d_assert_msg and _d_arraybounds are called instead. This allows the programmer to define these functions instead of _assert and use strings instead of char-pointers.
Comment #1 by robert.schadek — 2024-12-13T19:10:40Z