lua-users home
lua-l archive

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


luaL_loadfilex calls errfile that buld the error message including the filename:
    const char *filename = lua_tostring(L, fnameindex) + 1;
    lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr);


luaL_loadfilex is an example; my question is general, also for other functions.

The filename could be very long.
In my specific environment - embedded with low memory - it is better error messages have a predictable max size.
This isn't possible if they depends on a variable value.

If the caller of the API wants a verbose message, it knows the filename and so can add it.
If the caller of the API has constraints... it is a bit difficult to remove the filename from the error messages...

Please let me see your thoughts about this.

M

_______________________________________________
lua-l mailing list -- lua-l@lists.lua.org
To unsubscribe send an email to lua-l-leave@lists.lua.org