www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21135] New: Add -checkaction=D support to BetterC

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 puremagic.com
          Reporter: kytodragon 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.

--
Aug 07 2020