rttrorg / rttr

C++ Reflection Library
https://www.rttr.org
MIT License
3.11k stars 429 forks source link

Build failure | Android | Clang #372

Closed golxzn closed 3 months ago

golxzn commented 4 months ago

Hi! I've added the RTTR library using CMake as the submodule, and it works fine on Windows and iOS. But Android doesn't compile because of explicit conversation from int and long to float in the number_conversion.h file. Here's the build output:

13:04:27  C/C++: /home/proj/lib/rttr/src/rttr/../rttr/detail/conversion/number_conversion.h:137:16: error: implicit conversion from 'type' (aka 'int') to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]
13:04:27  C/C++: /home/proj/lib/rttr/src/rttr/../rttr/detail/variant/variant_data_converter.h:1060:16: note: in instantiation of function template specialization 'rttr::detail::convert_to<float, int>' requested here

Of course I can build it by disabling -Wimplicit-const-int-float-conversion, but it causes really big problems and undefined behavior.