lua-users home
lua-l archive

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


Good morning, Luiz,

Thanks for the update, I'll be running some tests this week.

One small issue I ran into:

luaL_archcheck and luaL_argexpected now use l_likely.

Because l_likely does not put its arguments in parentheses the following change removed the parentheses from the argument 'cond' after macro expansion, which gave me some warnings in my code. 

It did not break anything, but someone might possibly be bitten by this if they use the ternary operator (?:) without parentheses as the argument 'cond'. Probably not great code, but you never know.

Current definition:
 #define luaL_argcheck(L, cond,arg,extramsg)    \
       ((void)(l_likely(cond) || luaL_argerror(L, (arg), (extramsg))))

Perhaps l_likely should be defined as "#define l_likely(x) (x)", or luaL_argcheck as:

#define luaL_argcheck(L, cond, arg, extramsg) \
    ((void)(l_likely((cond)) || luaL_argerror(L, (arg), (extramsg))))

This would bring back the parentheses after macro expansion.


Gé 


--