this statement may fall through [-Werror=implicit-fallthrough=] 编译报错的解决方法
使用__attribute__((__fallthrough__))(亲测有效,且kernel中很多地方在用);在switch中不期望break的地方,使用#pragma GCC diagnostic 禁用警告 没有break而发生警告。警告不会导致编译报错,但是编译参数中定义了。
原创
2023-06-20 11:57:36 ·
1970 阅读 ·
0 评论