mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.35k stars 1.33k forks source link

symbol_projection.cpp - error: narrowing conversion #16522

Open jwinarske opened 3 years ago

jwinarske commented 3 years ago

In release v1.6.0 I see this error building with QNX SDP 7.0.0. Adding static_cast on the last return parameter resolves the issue.

/home/joel/third_party/mapbox-gl-native/src/mbgl/layout/symbol_projection.cpp: In function 'mbgl::PointAndCameraDistance mbgl::project(mbgl::Point&, const mat4&)': /home/joel/third_party/mapbox-gl-native/src/mbgl/layout/symbol_projection.cpp:98:102: error: narrowing conversion of 'pos.std::1::array<_Tp, _Size>::operator[]<double, 4ul>(3ul)' from 'std::1::array<double, 4ul>::value_type {aka double}' to 'float' inside { } [-Werror=narrowing] return {{ static_cast(pos[0] / pos[3]), static_cast(pos[1] / pos[3]) }, pos[3] };

furqonat commented 2 years ago

same error here