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 using EnTT in my project, on which I have set up -Wall -Wextra -Wpedantic -Wconversion as usual. But due to EnTT being a header only library, those flags apply to EnTT code as well.
For quite a while I have already silenced those warnings that EnTT emitted in the code directly (being the only solution AFAIK):
Recently, then, I updated the submodule and got some more warnings from EnTT.
It might be bold, but I want to propose to enable -Wconversion in all (test, example) targets built by EnTT and to fix the warnings in the code. You might not want that and I understand, I'll not be upset. :) I just think it might be a good idea. (Once a conversion warning saved me from a bug!)
/home/simon/PROJECTS/SOME_PROJECT/extern/entt/src/entt/signal/../container/dense_map.hpp:340:34: warning: conversion from ‘entt::dense_map<unsigned int, std::shared_ptr<entt::internal::basic_dispatcher_handler>, entt::identity, std::equal_to<void>, std::allocator<std::pair<const unsigned int, std::shared_ptr<entt::internal::basic_dispatcher_handler> > > >::size_type’ {aka ‘long unsigned int’} to ‘float’ may change value [-Wconversion]
340 | if(size() > (bucket_count() * max_load_factor())) {
| ~~~~~~~~~~~~^~
/home/simon/PROJECTS/SOME_PROJECT/extern/entt/src/entt/signal/../container/dense_map.hpp:340:16: warning: conversion from ‘entt::dense_map<unsigned int, std::shared_ptr<entt::internal::basic_dispatcher_handler>, entt::identity, std::equal_to<void>, std::allocator<std::pair<const unsigned int, std::shared_ptr<entt::internal::basic_dispatcher_handler> > > >::size_type’ {aka ‘long unsigned int’} to ‘float’ may change value [-Wconversion]
340 | if(size() > (bucket_count() * max_load_factor())) {
| ~~~~^~
/home/simon/PROJECTS/SOME_PROJECT/extern/entt/src/entt/signal/../container/dense_map.hpp:983:53: warning: conversion from ‘entt::dense_map<unsigned int, std::shared_ptr<entt::internal::basic_dispatcher_handler>, entt::identity, std::equal_to<void>, std::allocator<std::pair<const unsigned int, std::shared_ptr<entt::internal::basic_dispatcher_handler> > > >::size_type’ {aka ‘long unsigned int’} to ‘float’ may change value [-Wconversion]
983 | const auto cap = static_cast<size_type>(size() / max_load_factor());
| ~~~~^~
``
The text was updated successfully, but these errors were encountered:
I use only one or two parts of the EnTT library, so there are only three parts of the code that generate conversion warnings (the ones above). But during build, those are being emitted multiple times, printing relatively large blocks of text.
Hello!
I'm using EnTT in my project, on which I have set up
-Wall -Wextra -Wpedantic -Wconversion
as usual. But due to EnTT being a header only library, those flags apply to EnTT code as well.For quite a while I have already silenced those warnings that EnTT emitted in the code directly (being the only solution AFAIK):
But it's a bit annoying to do that in all places.
Recently, then, I updated the submodule and got some more warnings from EnTT.
It might be bold, but I want to propose to enable
-Wconversion
in all (test, example) targets built by EnTT and to fix the warnings in the code. You might not want that and I understand, I'll not be upset. :) I just think it might be a good idea. (Once a conversion warning saved me from a bug!)The text was updated successfully, but these errors were encountered: