RPC
RPC copied to clipboard
error: narrowing conversion of ‘***********’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
hello: I'm trying to build rpc library from source.
When executing command:
cmake --build . --target install
show err :
/home/fastdds/RPC-master/examples/C++/rpcdds/c++11Types/RTPSCalculator/CalculatorDDSProtocol.cxx:131:22: error: narrowing conversion of ‘3418803882’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
131 | case 0xCBC6CEAA:
| ^~~~~~~~~~
/home/fastdds/RPC-master/examples/C++/rpcdds/c++11Types/RTPSCalculator/CalculatorDDSProtocol.cxx:174:22: error: narrowing conversion of ‘3389102612’ from ‘unsigned int’ to ‘int’ [-Wnarrowing]
174 | case 0xCA019A14:
| ^~~~~~~~~~
I add the following words in my cmakelists.txt to avoid narrow conversion.
add_compile_options(-Wno-narrowing)
Thank you, the problem has been resolved.