Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove warnings when compiling with GCC 10.2.1 20201203 on Linux, fix #66 #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AlbertoGP
Copy link

This leaves only one warning:

/usr/bin/ld: liblua.a(loslib.o): in function `os_tmpname':
loslib.c:(.text+0x4e4): warning: the use of `tmpnam' is dangerous, better use `mkstemp'

There is a note about this in lua/src/luaconf.h:

lua_tmpnam is the function that the OS library uses to create a temporary name.
LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam.
CHANGE them if you have an alternative to tmpnam (which is considered insecure) or if you want the original tmpnam anyway.
By default, Lua uses tmpnam except when POSIX is available, where it uses mkstemp.

If I understand this correctly, when running on Linux it would not use tmpnam anyway. If so, it would be nice to quiet this warning too.

@AlbertoGP AlbertoGP changed the title Fix warnings when compiling with GCC 10.2.1 20201203 on Linux, fix #66 Fix warnings when compiling with GCC 10.2.1 20201203 on Linux, fixes #66 Oct 7, 2022
@AlbertoGP AlbertoGP changed the title Fix warnings when compiling with GCC 10.2.1 20201203 on Linux, fixes #66 Fix warnings when compiling with GCC 10.2.1 20201203 on Linux, fix #66 Oct 7, 2022
@AlbertoGP AlbertoGP changed the title Fix warnings when compiling with GCC 10.2.1 20201203 on Linux, fix #66 Remove warnings when compiling with GCC 10.2.1 20201203 on Linux, fix #66 Oct 7, 2022
It is clear that the intention was to run `lua_addvalue()` only if there
is no error because lua_error() “never returns” ←
`load81/lua/doc/manual.html#luaL_error`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant