|
> [...]
>The ISO standard says that about assert:
> In the end, that line (and some others in that file) is replaced by
> something like this:
>
> CClosure *func = (lua_assert(ttisCclosure(o)), &val_(ci->func).gc->cl.c)
>
> The idea is that you force an assertion but only make an assignment of the
> right side of the parenthesis _expression_. The problem is "lua_assert",
> AFAIK, it's supposed to be replaced by an OS dependent version (Lua defines
> it void), which in many cases is a macro that looks like this:
>
> #define OS_ASSERT do { /*STUFF*/ } while(0)
7.2.1.1 The assert macro
Synopsis
#include <assert.h>
void assert(scalar _expression_);
Description
The assert macro puts diagnostic tests into programs; it expands to a
void _expression_.
A do while loop is not an _expression_; therefore, such definition for
assert is invalid according to the standard.
-- Roberto