lua-users home
lua-l archive

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


> 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?

At least for now we do not want to add more strange macros in the API.
There are two easy fixs for those warnings:

   luaL_argcheck(L, 0 <= f, farg, "field cannot be negative");
   luaL_argcheck(L, 0 < w, farg + 1, "width must be positive");
+  *width = w;
   if (f + w > LUA_NBITS)
     return luaL_error(L, "trying to access non-existent bits");
-  *width = w;
   return f;

or

   luaL_argcheck(L, 0 <= f, farg, "field cannot be negative");
   luaL_argcheck(L, 0 < w, farg + 1, "width must be positive");
   if (f + w > LUA_NBITS)
-    return luaL_error(L, "trying to access non-existent bits");
+    luaL_error(L, "trying to access non-existent bits");
   *width = w;
   return f;

-- Roberto