lua-users home
lua-l archive

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


Compiling 5.1.2 with Metrowerks CodeWarrior for an embedded ARM I get a number of warnings (see below), mostly pertaining to signed <--> unsigned conversions (where I checked, the compiler seems to be correct).

Is this known behavior? (I don't remember seeing them when I compiled for C++ Builder a few versions ago, but they could have been disabled). I may be a bit nitpicking, but I like to see no warnings at all in my programs :-) (and I think that at least the lua_pushnumber conversion should definitely be explicit)

  Enrico

----------
Warning : implicit arithmetic conversion from 'int' to 'unsigned long'
lapi.c line 362       case LUA_TTABLE: return luaH_getn(hvalue(o));

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lauxlib.c line 347 luaL_addlstring(&b, s, wild - s); /* push prefix */

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lauxlib.c line 364       lua_pushlstring(L, fname, e - fname);

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lauxlib.c line 369         lua_pushlstring(L, fname, e - fname);

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lauxlib.c line 399     size_t l = bufflen(B);

Warning : implicit arithmetic conversion from 'int' to 'double'
lbaselib.c line 212         lua_pushnumber(L, res);

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lcode.c line 316 e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info);

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lcode.c line 355         luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info);

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lcode.c line 359 luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval));

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lcode.c line 486         luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info);

Warning : implicit arithmetic conversion from 'int' to 'unsigned long'
lfunc.c line 24     Closure *c =  sizeof(TValue)*((nelems)-1))))))));

Warning : implicit arithmetic conversion from 'int' to 'unsigned long'
lfunc.c line 34     Closure *c = izeof(TValue *)*((nelems)-1))))))));

Warning : implicit arithmetic conversion from 'int' to 'unsigned long'
lfunc.c line 155     aM_realloc_(L, ( c), ( size), 0);

Warning : implicit arithmetic conversion from 'unsigned long' to 'long'
lgc.c line 288                                sizeof(Node) * sizenode(h);

Warning : implicit arithmetic conversion from 'unsigned long' to 'long'
lgc.c line 305 sizeof(CallInfo) * th->size_ci;

Warning : implicit arithmetic conversion from 'unsigned long' to 'long'
lgc.c line 316 sizeof(TString *) * p->sizeupvalues;

Warning : implicit arithmetic conversion from 'unsigned int' to 'long'
lgc.c line 612     l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul;

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lmathlib.c line 210     srand(luaL_checkint(L, 1));

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
lobject.c line 41     if (x < 8) return x;

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lobject.c line 117       *)( ( luaS_newlstr(L, fmt, e-fmt))));

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lparser.c line 320 init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1));

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lparser.c line 535 (Instruction)( luaO_int2fb(cc.na))); /* set initial array size */

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lparser.c line 536 (Instruction)( luaO_int2fb(cc.nh))); /* set initial table size */

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lparser.c line 1080 luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1));

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
lstring.c line 65     h = lmod(h, tb->size);

Warning : implicit arithmetic conversion from 'unsigned long' to 'long'
lstrlib.c line 31     lua_pushinteger(L, l);

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 50       lua_pushlstring(L, s+start-1, end-start+1);

Warning : implicit arithmetic conversion from 'unsigned long' to 'long'
lstrlib.c line 112     if ((size_t)pose > l) pose = l;

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 356     len = ms->capture[l].len;

Warning : implicit arithmetic conversion from 'int' to 'char'
lstrlib.c line 390 previous = (s == ms->src_init) ? '\0' : *(s-1);

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 469 lua_pushlstring(ms->L, s, e - s); /* add whole match */

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 479         lua_pushlstring(ms->L, ms->capture[i].init, l);

Warning : implicit arithmetic conversion from 'unsigned long' to 'long'
lstrlib.c line 507         lua_pushinteger(L, s2-s+l2);

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 601             luaL_addlstring(b, s, e - s);

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 639 lua_pushlstring(L, s, e - s); /* keep original text */

Warning : implicit arithmetic conversion from 'unsigned long' to 'long'
lstrlib.c line 651     int max_s = aL_optinteger(L, ( 4), ( srcl+1)));

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 675     luaL_addlstring(&b, src, ms.src_end-src);

Warning : implicit arithmetic conversion from 'long' to 'unsigned long'
lstrlib.c line 739     strncpy(form, strfrmt, p - strfrmt + 1);

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
ltable.c line 214 nums[(luaO_log2((k)-1) + 1)]++; /* count as such */

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
ltable.c line 280       lsize =  (luaO_log2((size)-1) + 1);

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
ltable.c line 536     while (!((luaH_getnum(t, j))->tt)) {

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
ltable.c line 542         while (!((luaH_getnum(t, i))->tt)) i++;

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
ltable.c line 543         return i - 1;

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
ltable.c line 549       if (((luaH_getnum(t, m))->tt)) j = m;

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
ltable.c line 552     return i;

Warning : implicit arithmetic conversion from 'int' to 'unsigned int'
ltable.c line 561     unsigned int j = t->sizearray;

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
ltable.c line 570       return i;

Warning : implicit arithmetic conversion from 'unsigned int' to 'int'
ltable.c line 574       return j;  /* that is easy... */