lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> To avoid confusion with compiler cutting asserts away on release
> builds, how about using abort() instead of assert(0)?

The compiler does not cut away printf.
This is the output I forgot to add in the mail 7 minutes ago:

Lua 5.4
passed line 94
passed line 104
passed line 115
passed line 126
passed line 137
dead
passed line 149
Test the test!
ERROR in line 153: is = 1, expected = 2


The final ERROR line tests that the test will trigger.
So I can be definitely sure, this is not a DEBUG vs. RELEASE or abort() vs. assert() issue.


On Mon, Mar 1, 2021 at 7:59 PM v <v19930312@gmail.com> wrote:
On Mon, 2021-03-01 at 19:54 +0100, bel wrote:
>
> #define UNREACHABLE {printf("Reached unreachable code at %u\n",
> __LINE__); assert(0);}

To avoid confusion with compiler cutting asserts away on release
builds, how about using abort() instead of assert(0)?
--
v <v19930312@gmail.com>