Skip to content

Commit

Permalink
[warnings] fix warnings from new clang version
Browse files Browse the repository at this point in the history
  • Loading branch information
harrand committed Dec 3, 2024
1 parent 1497ffa commit c456b64
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmake/compiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ endfunction()
function(configure_gnu_like)
# GNU-like compiler. i.e gcc + clang, but not msvc or clang-cl.
# TODO
target_compile_options(topaz PRIVATE -Wall -Wextra -Werror -pedantic-errors)
target_compile_options(topaz PRIVATE -Wall -Wextra -Werror -pedantic-errors -Wno-missing-field-initializers)
endfunction()

function(configure_clang)
Expand Down
3 changes: 2 additions & 1 deletion include/tz/core/error.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef TOPAZ_CORE_ERROR_HPP
#define TOPAZ_CORE_ERROR_HPP
#include <string_view>
#include <string>
#include <array>

namespace tz
Expand Down Expand Up @@ -64,4 +65,4 @@ namespace tz

}

#endif // TOPAZ_CORE_ERROR_HPP
#endif // TOPAZ_CORE_ERROR_HPP
5 changes: 3 additions & 2 deletions src/tz/core/lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ namespace tz

tz::error_code lua_define_function(std::string_view varname, lua_fn fn)
{
lua_pushcfunction(lua, reinterpret_cast<lua_CFunction>(fn));
// note: this is undefined behaviour
lua_pushcfunction(lua, reinterpret_cast<lua_CFunction>(reinterpret_cast<std::uintptr_t>(fn)));
std::string tmp = std::format("tmp_{}", varname);
lua_setglobal(lua, tmp.c_str());
lua_execute(std::format("{} = {}", varname, tmp));
Expand Down Expand Up @@ -254,4 +255,4 @@ namespace tz
}
return type;
}
}
}

0 comments on commit c456b64

Please sign in to comment.