https://issues.dlang.org/show_bug.cgi?id=21135
Issue ID: 21135
Summary: Add -checkaction=D support to BetterC
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
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.
--