[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.2.2 (rc3) now available
- From: Miles Bader <miles@...>
- Date: Fri, 15 Mar 2013 11:15:59 +0900
FWIW, I get the following warnings:
/usr/local/src/lua-5.2.2-work3/src/lbitlib.c: In function 'b_extract':
/usr/local/src/lua-5.2.2-work3/src/lbitlib.c:168:18: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
r = (r >> f) & mask(w);
^
/usr/local/src/lua-5.2.2-work3/src/lbitlib.c:165:7: note: 'w' was declared here
int w;
^
/usr/local/src/lua-5.2.2-work3/src/lbitlib.c: In function 'b_replace':
/usr/local/src/lua-5.2.2-work3/src/lbitlib.c:179:11: warning: 'w' may be used uninitialized in this function [-Wmaybe-uninitialized]
int m = mask(w);
^
/usr/local/src/lua-5.2.2-work3/src/lbitlib.c:175:7: note: 'w' was declared here
int w;
^
Looking at the code, it seems that the warning is because the
"fieldargs" function doesn't write to its output-parameter in the case
of an error return, and the compiler probably doesn't know that
luaL_error never returns...
As the Lua source already seems to have support for no-return
annotations (using the "l_noret" macro), perhaps that annotation could
be added to lua_error and luaL_error?
Thanks,
-miles
--
永日の 澄んだ紺から 永遠へ