diff --git a/include/misc/Format.h b/include/misc/Format.h index 4c23dc9..4cc7198 100644 --- a/include/misc/Format.h +++ b/include/misc/Format.h @@ -14,7 +14,7 @@ std::string format(const std::string& format, Args... args){ throw std::runtime_error("Error during formatting."); } std::unique_ptr buf(new char[size]); - snprintf(buf.get(), size, format.c_str(), args...); + snprintf(buf.get(), static_cast(size), format.c_str(), args...); return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside } diff --git a/xmake.lua b/xmake.lua index 0fc95c2..f9cd23b 100644 --- a/xmake.lua +++ b/xmake.lua @@ -37,7 +37,7 @@ target("TowerDefense") if is_os("windows") then add_links("dbghelp", "psapi", "kernel32", "msvcr90") end - add_cxflags("-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused") + add_cxflags("-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=1 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Wold-style-cast -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef -Wno-unused") end