Fix compiler warnings wrt conversion and sign-conversion produced by gcc 10
Check and fix warnings produced by gcc 10.2 (Ubuntu 20.10) coming from conversion and sign-conversion
FAILED: ezC2X/cdd/CMakeFiles/cdd.dir/__/__/include/ezC2X/cdd/types/EventHistory.pb.cc.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -Dcdd_EXPORTS -I../ -Iinclude -I../ezC2X/cdd -IezC2X/cdd -O3 -DNDEBUG -fPIC -Werror -pedantic-errors -Wall -Wconversion -Wsign-conversion -pthread -MD -MT ezC2X/cdd/CMakeFiles/cdd.dir/__/__/include/ezC2X/cdd/types/EventHistory.pb.cc.o -MF ezC2X/cdd/CMakeFiles/cdd.dir/__/__/include/ezC2X/cdd/types/EventHistory.pb.cc.o.d -o ezC2X/cdd/CMakeFiles/cdd.dir/__/__/include/ezC2X/cdd/types/EventHistory.pb.cc.o -c include/ezC2X/cdd/types/EventHistory.pb.cc
include/ezC2X/cdd/types/EventHistory.pb.cc: In member function ‘virtual google::protobuf::uint8* ezC2X::cdd::EventHistory::_InternalSerialize(google::protobuf::uint8*, google::protobuf::io::EpsCopyOutputStream*) const’:
include/ezC2X/cdd/types/EventHistory.pb.cc:203:59: error: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Werror=sign-conversion]
203 | InternalWriteMessage(1, this->_internal_event_point(i), target, stream);
| ^
include/ezC2X/cdd/types/EventHistory.pb.cc: In member function ‘virtual size_t ezC2X::cdd::EventHistory::ByteSizeLong() const’:
include/ezC2X/cdd/types/EventHistory.pb.cc:223:55: error: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Werror=sign-conversion]
223 | total_size += 1UL * this->_internal_event_point_size();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
cc1plus: all warnings being treated as errors
FAILED: ezC2X/network/CMakeFiles/network.dir/__/__/include/ezC2X/network/geonet/ipc/GnParameters.pb.cc.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -Dnetwork_EXPORTS -I../ -Iinclude -I../ezC2X/network -IezC2X/network -O3 -DNDEBUG -fPIC -Werror -pedantic-errors -Wall -Wconversion -Wno-sign-conversion -pthread -MD -MT ezC2X/network/CMakeFiles/network.dir/__/__/include/ezC2X/network/geonet/ipc/GnParameters.pb.cc.o -MF ezC2X/network/CMakeFiles/network.dir/__/__/include/ezC2X/network/geonet/ipc/GnParameters.pb.cc.o.d -o ezC2X/network/CMakeFiles/network.dir/__/__/include/ezC2X/network/geonet/ipc/GnParameters.pb.cc.o -c include/ezC2X/network/geonet/ipc/GnParameters.pb.cc
include/ezC2X/network/geonet/ipc/GnParameters.pb.cc: In member function ‘virtual const char* ezC2X::ipc::GnThreeDLocation::_InternalParse(const char*, google::protobuf::internal::ParseContext*)’:
include/ezC2X/network/geonet/ipc/GnParameters.pb.cc:1254:71: error: conversion from ‘google::protobuf::uint64’ {aka ‘long unsigned int’} to ‘google::protobuf::int32’ {aka ‘int’} may change value [-Werror=conversion]
1254 | longitude_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
include/ezC2X/network/geonet/ipc/GnParameters.pb.cc:1261:70: error: conversion from ‘google::protobuf::uint64’ {aka ‘long unsigned int’} to ‘google::protobuf::int32’ {aka ‘int’} may change value [-Werror=conversion]
1261 | latitude_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
After fixing please reenable compiler flags -Wconversion;-Wsign-conversion
in CMakeLists.txt
$<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>:-Werror;-pedantic-errors;-Wall;-Wconversion;-Wsign-conversion>