lua-users home
lua-l archive

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


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

-- 
永日の 澄んだ紺から 永遠へ