Bug 21135 – Add -checkaction=D support to BetterC

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-08-07T15:13:19Z
Last change time
2024-12-13T19:10:40Z
Keywords
betterC
Assigned to
No Owner
Creator
KytoDragon
Moved to GitHub: dmd#17978 →

Comments

Comment #0 by kytodragon — 2020-08-07T15:13:19Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17978 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB