Check and fix compiler warnings produced by gcc 10.2
Check and fix warnings produced by gcc 10.2 (Ubuntu 20.10) coming from deprecated-declarations
FAILED: ezC2X/facility/CMakeFiles/facility.dir/data_presentation/ProtobufDataPresentation.cpp.o
/usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -Dfacility_EXPORTS -I../ -Iinclude -I../ezC2X/facility -IezC2X/facility -O3 -DNDEBUG -fPIC -Werror -pedantic-errors -Wall -Wno-conversion -Wno-sign-conversion -pthread -MD -MT ezC2X/facility/CMakeFiles/facility.dir/data_presentation/ProtobufDataPresentation.cpp.o -MF ezC2X/facility/CMakeFiles/facility.dir/data_presentation/ProtobufDataPresentation.cpp.o.d -o ezC2X/facility/CMakeFiles/facility.dir/data_presentation/ProtobufDataPresentation.cpp.o -c ../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp
../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp: In member function ‘virtual ezC2X::Packet ezC2X::ProtobufDataPresentation::encodeCam(const ezC2X::Cam&)’:
../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:8:65: error: ‘int google::protobuf::MessageLite::ByteSize() const’ is deprecated: Please use ByteSizeLong() instead [-Werror=deprecated-declarations]
8 | auto camSizeInBytes = static_cast<std::size_t>(cam.ByteSize());
| ^
In file included from /usr/include/google/protobuf/generated_enum_util.h:36,
from /usr/include/google/protobuf/map.h:55,
from /usr/include/google/protobuf/generated_message_table_driven.h:34,
from include/ezC2X/facility/cam/Cam.pb.h:26,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.hpp:11,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:1:
/usr/include/google/protobuf/message_lite.h:420:7: note: declared here
420 | int ByteSize() const { return internal::ToIntSize(ByteSizeLong()); }
| ^~~~~~~~
../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:14:58: error: ‘int google::protobuf::MessageLite::ByteSize() const’ is deprecated: Please use ByteSizeLong() instead [-Werror=deprecated-declarations]
14 | if (!cam.SerializeToArray(packet.raw(), cam.ByteSize()))
| ^
In file included from /usr/include/google/protobuf/generated_enum_util.h:36,
from /usr/include/google/protobuf/map.h:55,
from /usr/include/google/protobuf/generated_message_table_driven.h:34,
from include/ezC2X/facility/cam/Cam.pb.h:26,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.hpp:11,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:1:
/usr/include/google/protobuf/message_lite.h:420:7: note: declared here
420 | int ByteSize() const { return internal::ToIntSize(ByteSizeLong()); }
| ^~~~~~~~
../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp: In member function ‘virtual ezC2X::Packet ezC2X::ProtobufDataPresentation::encodeDenm(const ezC2X::Denm&)’:
../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:25:67: error: ‘int google::protobuf::MessageLite::ByteSize() const’ is deprecated: Please use ByteSizeLong() instead [-Werror=deprecated-declarations]
25 | auto denmSizeInBytes = static_cast<std::size_t>(denm.ByteSize());
| ^
In file included from /usr/include/google/protobuf/generated_enum_util.h:36,
from /usr/include/google/protobuf/map.h:55,
from /usr/include/google/protobuf/generated_message_table_driven.h:34,
from include/ezC2X/facility/cam/Cam.pb.h:26,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.hpp:11,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:1:
/usr/include/google/protobuf/message_lite.h:420:7: note: declared here
420 | int ByteSize() const { return internal::ToIntSize(ByteSizeLong()); }
| ^~~~~~~~
../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:31:60: error: ‘int google::protobuf::MessageLite::ByteSize() const’ is deprecated: Please use ByteSizeLong() instead [-Werror=deprecated-declarations]
31 | if (!denm.SerializeToArray(packet.raw(), denm.ByteSize()))
| ^
In file included from /usr/include/google/protobuf/generated_enum_util.h:36,
from /usr/include/google/protobuf/map.h:55,
from /usr/include/google/protobuf/generated_message_table_driven.h:34,
from include/ezC2X/facility/cam/Cam.pb.h:26,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.hpp:11,
from ../ezC2X/facility/data_presentation/ProtobufDataPresentation.cpp:1:
/usr/include/google/protobuf/message_lite.h:420:7: note: declared here
420 | int ByteSize() const { return internal::ToIntSize(ByteSizeLong()); }
| ^~~~~~~~
cc1plus: all warnings being treated as errors
Remark: This issue initially covered more warning issues and wa split into this one and #281