You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting various implicit conversion errors with clang when emplacing entities. Most of the errors are because integers literals are used to construct an edyn::scalar member.
Still, i found it very weird when conversion warnings shouldn't be treated as errors.
Here's an example:
[15/91] Building CXX object _deps/edyn-build/CMakeFiles/Edyn.dir/src/edyn/collision/narrowphase.cpp.o
FAILED: _deps/edyn-build/CMakeFiles/Edyn.dir/src/edyn/collision/narrowphase.cpp.o
/usr/bin/clang++ -DEDYN_DISABLE_ASSERT -DENTT_DISABLE_ASSERT -I_deps/edyn-src/include -I_deps/edyn-build/include -I_deps/entt-src/src -O3 -DNDEBUG -Wall -Wno-reorder -Wno-long-long -Wimplicit-fallthrough -std=gnu++17 -MD -MT _deps/edyn-build/CMakeFiles/Edyn.dir/src/edyn/collision/narrowphase.cpp.o -MF _deps/edyn-build/CMakeFiles/Edyn.dir/src/edyn/collision/narrowphase.cpp.o.d -o _deps/edyn-build/CMakeFiles/Edyn.dir/src/edyn/collision/narrowphase.cpp.o -c _deps/edyn-src/src/edyn/collision/narrowphase.cpp
In file included from _deps/edyn-src/src/edyn/collision/narrowphase.cpp:1:
In file included from _deps/edyn-src/include/edyn/collision/narrowphase.hpp:6:
In file included from _deps/entt-src/src/entt/entity/registry.hpp:21:
In file included from _deps/entt-src/src/entt/entity/group.hpp:12:
In file included from _deps/entt-src/src/entt/entity/pool.hpp:6:
_deps/entt-src/src/entt/entity/storage.hpp:365:38: error: non-constant-expression cannot be narrowed from type 'int' to 'edyn::scalar' (aka 'float') in initializer list [-Wc++11-narrowing]
instances.push_back(Type{std::forward<Args>(args)...});
^~~~~~~~~~~~~~~~~~~~~~~~
_deps/entt-src/src/entt/entity/registry.hpp:64:46: note: in instantiation of function template specialization 'entt::storage<entt::entity, edyn::contact_point, void>::emplace<std::array<entt::entity, 2> &, const edyn::vector3 &, const edyn::vector3 &, const edyn::vector3 &, int, int, int, const float &>' requested here
storage<entity_type, Component>::emplace(entt, std::forward<Args>(args)...);
^
_deps/entt-src/src/entt/entity/storage.hpp:365:38: note: insert an explicit cast to silence this issue
instances.push_back(Type{std::forward<Args>(args)...});
^~~~~~~~~~~~~~~~~~~~~~~~
static_cast<scalar>( )
_deps/entt-src/src/entt/entity/storage.hpp:365:38: error: non-constant-expression cannot be narrowed from type 'int' to 'edyn::scalar' (aka 'float') in initializer list [-Wc++11-narrowing]
instances.push_back(Type{std::forward<Args>(args)...});
^~~~~~~~~~~~~~~~~~~~~~~~
_deps/entt-src/src/entt/entity/storage.hpp:365:38: note: insert an explicit cast to silence this issue
instances.push_back(Type{std::forward<Args>(args)...});
^~~~~~~~~~~~~~~~~~~~~~~~
static_cast<scalar>( )
_deps/entt-src/src/entt/entity/storage.hpp:365:38: error: non-constant-expression cannot be narrowed from type 'int' to 'uint32_t' (aka 'unsigned int') in initializer list [-Wc++11-narrowing]
instances.push_back(Type{std::forward<Args>(args)...});
^~~~~~~~~~~~~~~~~~~~~~~~
_deps/entt-src/src/entt/entity/storage.hpp:365:38: note: insert an explicit cast to silence this issue
instances.push_back(Type{std::forward<Args>(args)...});
^~~~~~~~~~~~~~~~~~~~~~~~
static_cast<uint32_t>( )
3 errors generated.
The text was updated successfully, but these errors were encountered:
I'm getting various implicit conversion errors with clang when emplacing entities. Most of the errors are because integers literals are used to construct an
edyn::scalar
member.Still, i found it very weird when conversion warnings shouldn't be treated as errors.
Here's an example:
The text was updated successfully, but these errors were encountered: