Grpc: Compiler error with g++ 8.2.1: bitwise comparison always evaluates to false [-Werror=tautological-compare] and more

Created on 8 Mar 2019  Â·  3Comments  Â·  Source: grpc/grpc

What version of gRPC and what language are you using?

v1.19.0

What operating system (Linux, Windows,...) and version?

Arch linux

What runtime / compiler are you using (e.g. python version or version of gcc)

c++ (GCC) 8.2.1 20181127

What did you do?

build mit make

What did you expect to see?

it compiles

What did you see instead?

the following compiling error:
src/core/lib/iomgr/tcp_posix.cc: In function ‘void process_errors({anonymous}::grpc_tcp*)’: src/core/lib/iomgr/tcp_posix.cc:746:38: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] if ((msg.msg_flags & MSG_CTRUNC) == 1) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ... cc1plus: all warnings being treated as errors make: *** [Makefile:2989: /home/wenwen/ich/grpc/objs/opt/src/core/lib/iomgr/tcp_posix.o] Error 1 make: *** Waiting for unfinished jobs.... src/core/ext/transport/chttp2/transport/chttp2_transport.cc: In function ‘grpc_error* try_http_parsing(grpc_chttp2_transport*)’: src/core/ext/transport/chttp2/transport/chttp2_transport.cc:2466:40: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘grpc_http_response’ {aka ‘struct grpc_http_response’}; use assignment or value-initialization instead -Werror=class-memaccess] memset(&response, 0, sizeof(response)); ^ In file included from src/core/ext/transport/chttp2/transport/chttp2_transport.cc:44: ./src/core/lib/http/parser.h:71:16: note: ‘grpc_http_response’ {aka ‘struct grpc_http_response’} declared here typedef struct grpc_http_response { ^~~~~~~~~~~~~~~~~~ src/core/ext/transport/chttp2/transport/flow_control.cc: In member function ‘virtual uint32_t grpc_core::chttp2::TransportFlowControl::MaybeSendUpdate(bool)’: src/core/ext/transport/chttp2/transport/flow_control.cc:193:50: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers] static_cast<const uint32_t>(target_window());

Anything else we should know about your project / environment?

There was already two issue tickets issues 16652 and issues 15288 this problem, but it is closed and I can not find any info about this.

arebuild dispositiostale kinbug lancore prioritP3

Most helpful comment

Using as workaroudn:
env CC=clang env CXXFLAGS="-Wno-tautological-compare -Wno-class-memaccess -Wno-ignored-qualifiers" make

All 3 comments

Using as workaroudn:
env CC=clang env CXXFLAGS="-Wno-tautological-compare -Wno-class-memaccess -Wno-ignored-qualifiers" make

Should be fixed by https://github.com/grpc/grpc/pull/17971 which should be part of v1.21.0

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 180 days. It will be closed automatically if no further update occurs in 1 day. Thank you for your contributions!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

blerest picture blerest  Â·  3Comments

ctiller picture ctiller  Â·  3Comments

draft6 picture draft6  Â·  3Comments

charliesneath picture charliesneath  Â·  3Comments

rschmied picture rschmied  Â·  3Comments