报错解决:error: this statement may fall through [-Werror=implicit-fallthrough=]
下午在编译 grpc时报错如下:
utilities/blob_db/blob_log_reader.cc:74:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
next_byte_ += kb_size;
~~~~~~~~~~~^~~~~~~~~~
utilities/blob_db/blob_log_reader.cc:76:5: note: here
case kReadHeaderKey:
^~~~
utilities/blob_db/blob_log_reader.cc:94:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
next_byte_ += record->GetBlobSize();
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
utilities/blob_db/blob_log_reader.cc:96:5: note: here
case kReadHeaderKeyBlob:
^~~~
cc1plus: all warnings being treated as errors
Makefile:1813: recipe for target 'utilities/blob_db/blob_log_reader.o' failed
make: *** [utilities/blob_db/blob_log_reader.o] Error 1
make: *** Waiting for unfinished jobs....
CMake Warning at CMakeLists.txt:122 (message):
gRPC_INSTALL will be forced to FALSE because gRPC_ZLIB_PROVIDER is "module"
CMake Error at third_party/boringssl/CMakeLists.txt:30 (message):
Could not find Go
-- Configuring incomplete, errors occurred!
See also "/home/zhang/paxosstore/certain/third/grpc/CMakeFiles/CMakeOutput.log".
See also "/home/zhang/paxosstore/certain/third/grpc/CMakeFiles/CMakeError.log".
[MAKE] Generating cache.mk
[AR] Creating /home/zhang/paxosstore/certain/third/grpc/libs/opt/libgpr.a
[C] Compiling third_party/boringssl/crypto/bio/fd.c
[C] Compiling third_party/boringssl/crypto/bio/file.c
[C] Compiling third_party/boringssl/crypto/bn/add.c
[C] Compiling third_party/boringssl/crypto/bn/asm/x86_64-gcc.c
third_party/boringssl/crypto/bio/file.c: In function ‘file_ctrl’:
third_party/boringssl/crypto/bio/file.c:186:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
num = 0;
~~~~^~~
third_party/boringssl/crypto/bio/file.c:187:5: note: here
case BIO_C_FILE_SEEK:
^~~~
third_party/boringssl/crypto/bio/fd.c: In function ‘fd_ctrl’:
third_party/boringssl/crypto/bio/fd.c:192:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
num = 0;
~~~~^~~
third_party/boringssl/crypto/bio/fd.c:193:5: note: here
case BIO_C_FILE_SEEK:
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
解决方法如下:
make CFLAGS='-Wno-implicit-fallthrough'
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了