Closed KipHamiltons closed 3 years ago
this introduces just one compiler warning from protobuf, and I can't work out how to remove it haha
[1/3] Building CXX object controllers/nugus_controller/CMakeFiles/robot_control_protobuf.dir/protobuf/RobotControl.pb.cc.o
controllers/nugus_controller/protobuf/RobotControl.pb.cc: In member function ‘virtual const char* controller::nugus::RobotControl::_InternalParse(const char*, google::protobuf::internal::ParseContext*’:
controllers/nugus_controller/protobuf/RobotControl.pb.cc:98:65: warning: conversion from ‘google::protobuf::uint64’ {aka ‘long unsigned int’} to ‘google::protobuf::int32’ {aka ‘int’} may change value -Wconversion]
98 | num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
The way I delt with all the warnings in the generated code is I didn't have any warnings when compiling those files (I made them a separate library)
this introduces just one compiler warning from protobuf, and I can't work out how to remove it haha
[1/3] Building CXX object controllers/nugus_controller/CMakeFiles/robot_control_protobuf.dir/protobuf/RobotControl.pb.cc.o controllers/nugus_controller/protobuf/RobotControl.pb.cc: In member function ‘virtual const char* controller::nugus::RobotControl::_InternalParse(const char*, google::protobuf::internal::ParseContext*’: controllers/nugus_controller/protobuf/RobotControl.pb.cc:98:65: warning: conversion from ‘google::protobuf::uint64’ {aka ‘long unsigned int’} to ‘google::protobuf::int32’ {aka ‘int’} may change value -Wconversion] 98 | num_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
I had to disable a number of warnings on the generated protobuf files in the nubots codebase (probably in nuclear roles neutrons)
Yeah, one of the things that I did in the cmake modernise stuff is to move protobufs into their own nonsense land with no warnings so that NUbots doesn't disable all those warnings in the actual codebase
I found a really nice comprehensive list of compiler warnings and a script/function to add them. This adds them for this codebase.
should I do something similar for NUbots?