The option -U__STRICT_ANSI__ was required to get this building (see http://stackoverflow.com/a/22167294).
There remain some warnings that need to be squashed.
ubsan is reporting that a reference is binding to nullptr here, it seems
likely that the font pr caused bad behavior when the ttext object is
empty. this should hopefully correct it
Previously the aspect did not check whether a potential attacker belongs to the AI's side,
or whether a potential target is an enemy. This generally isn't a problem, but should probably
be fixed anyway. In particular, it affects the new ai.aspects.attacks result.
test/test_lua no longer applies
All it did was check rounding coming from Lua matched the expected values.
You can no long obtain an integer value from a Lua NUMBER (float), unless that float value has no fractional part and is in the range of valid integers. To obtain a rounded value, instead, use luaL_checknumber to obtain the float value and round it as needed (with a cast, floor or ceil, usually) in your program.
The lua_toint macro was deprecated for Lua 5.3.3; originally, Wesnoth changed the macro to use a static_cast<int>.
After upgrading to the lua_tointeger function, add the static_cast<int> at each call site to suppress warnings about possible loss of precision due to defining LUA_INTEGER as long long.
Checking a format for os.date may read pass the format string.
reported by Nagaev Boris on 10 Jul 2016. existed since 5.3.3.
Example:
This bug does not seem to happen with regular compilers. It needs an "interceptor" 'memcmp' function that continues reading memory after a difference is found.
Expression list with four or more expressions in a 'for' loop can crash the interpreter.
reported by Marco Schöpl on 17 Jun 2016. existed since 5.2.
Example:
-- the next loop will probably crash the interpreter
repeat until load "for _ in _,_,_,_ do local function _() end"
luaconf.h provides a place for us to make changes, avoiding the need to change the original definitions. Move everything down there. This encompases the following changes:
1) Disable compatibility with old versions of Lua in the C++. Compatability is maintained only for the Lua runtime. Only one correction was needed: in application_lua_kernel.cpp
2) Change how the backpointer is defined, for forward compatability with Lua 5.3. This effected only one line: in lua_kernel_base.cpp. Using the Lua 5.3 macro caused a GCC warning, suppressed it for that line.
3) Certain Windows-only features are no longer available in the Lua runtime. These features are all in the Lua io module, which we don't allow access to, so this is a non-change for the runtime.
4) Lua will behave as if it is a standard C environment. This, again, mainly effects the Windows environment and features we don't allow access to in the runtime.
Rather than change the source, if the proplem still exists, use a compiler flag to suppress the messages.
This reverts the commit
commit 12a7a5a1e0fee21e0c88042c6b3c7be1c73f30e3
Author: Mark de Wever <koraq@xs4all.nl>
Date: Sun Oct 6 17:35:11 2013 +0200
Remove unused const variables.
The issue was detected by the upcomming Clang 3.4.
Do not change the released Lua source code. Lua is written as standard C, but we compile it as C++ so we can use exceptions. Change the call sites to avoid the warnings about using a C cast instead of static_cast<int>().
NB: The changes to Wesnoth C++ code will be required to upgrade to Lua 5.3, anyway.
This reverts:
commit cee3ab208401a439e15004b79b4fa5c5bf9a9e5a
Author: Mark de Wever <koraq@xs4all.nl>
Date: Sun Feb 5 19:55:32 2012 +0000
Fix compiler warnings.
Do note that for some reason using the default_bold label definition with this change made an underline
appear. I changed the style checks to use == instead of & (bitwise AND) and that fixed the problem. If
that's wrong, someone feel free to fix that.