lua-users home
lua-l archive

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


Visual Studio 2017

I've added a cast on my fork (this is a mirror from https://www.lua.org/versions.html#5.3 with the https://www.lua.org/bugs.html applied).

and this fixed the warning. But I don't really like to patch Lua, because then when Lua 5.4 final will be out I will need to repatch it.

Thank you Roberto.

On Wed, Jan 16, 2019 at 7:52 AM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> On Lua 5.3.x there is a warning on the function lua_rawlen
> <https://github.com/lua/lua/blob/master/lapi.c#L396>

This link is not to Lua 5.3.x.


> warning C4244: 'return': conversion from 'lua_Unsigned' to 'size_t',
> possible loss of data
>
> I know is harmless warning, but would be nice to add a cast so we could
> have 0 warnings building Lua from source.

What is the compiler? What are the warning options? Are you sure
this is the only warning of this kind? (I think there are several
other instances of conversion from 'lua_Unsigned' or 'lua_Integer'
to 'size_t' in the code...)

-- Roberto