lua-users home
lua-l archive

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


    Hello,

    While trying to port lua to an embedded 16-bit platform, the
compiler warns me that the comparison in luaM_reallocv is always true:

#define luaM_reallocv(L,b,on,n,e) \
  ((cast(unsigned int, (n)+1) <= MAX_SIZET/(e)) ?  /* +1 to avoid warnings */ \
    luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \
    luaM_toobig(L))

    On my platform, size_t is 4 bytes (long), while 'int' is 2 bytes.
I changed the previous cast to 'unsigned long' and I didn't get the
warning anymore, but I wonder how does this affect Lua.
    Thank you,

    Bogdan M.