mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Avoid -fsanitize=integer warnings around zigzag encoding #113

Closed springmeyer closed 9 years ago

springmeyer commented 9 years ago

With clang++ -fsanitize=integer we get:

../src/vector_tile_geometry_encoder.hpp:112:42: runtime error: left shift of negative value -10
../src/vector_tile_geometry_encoder.hpp:113:42: runtime error: left shift of negative value -10

As per discussion with @danpat - these are both valid warnings and current code is working right (as per https://developers.google.com/protocol-buffers/docs/encoding#types). However would be ideal to avoid the warnings and be more explicit by using static_cast<unsigned>.