[Issue 21135] New: Add -checkaction=D support to BetterC
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Aug 7 15:13:19 UTC 2020
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: nobody at puremagic.com
Reporter: kytodragon at e.mail.de
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.
--
More information about the Digitalmars-d-bugs
mailing list