Compilation warnings being treated as errors with kernel >= 5.0.0
Build error when building against linux-5.0.0:
[CXX] Compiling src/core/ext/transport/chttp2/transport/chttp2_plugin.cc
[CXX] Compiling src/core/ext/transport/chttp2/transport/chttp2_transport.cc
[CXX] Compiling src/core/ext/transport/chttp2/transport/flow_control.cc
src/core/ext/transport/chttp2/transport/flow_control.cc: In member function ‘uint32_t grpc_core::chttp2::TransportFlowControl::MaybeSendUpdate(bool)’:
src/core/ext/transport/chttp2/transport/flow_control.cc:170:74: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
const uint32_t target_announced_window = (const uint32_t)target_window();
^
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2587: /root/Documents/tools/sysdig/sysdig/build/grpc-prefix/src/grpc/objs/opt/src/core/ext/transport/chttp2/transport/flow_control.o] Error 1
make[2]: *** [CMakeFiles/grpc.dir/build.make:117: grpc-prefix/src/grpc-stamp/grpc-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:446: CMakeFiles/grpc.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
I also the same error, but I solved it by set the following environment variable.
$ env CXXFLAGS = "-Wno-ignored-qualifiers -Wno-stringop-truncation -Wno-cast-function-type" make
Doesn't stringop-truncation warn against strncpy that might truncate null terminated strings? The cast-function-type warns against casting pointers of one type to another, which can cause indeterminate behaviour. So what these cxxflags do is to allow these coding faux pas to happen. Not so good when it is a kernel module.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.