begeekmyfriend/bplustree

执行demo_build.sh 提示 statement may fall through

yxyyyxxyy opened this issue · 2 comments

您好,我执行 ./demo_build.sh 时有如下错误

/home/yxy/桌面/bplustree/tests/bplustree_demo.c: In function ‘bplus_tree_setting’:
/home/yxy/桌面/bplustree/tests/bplustree_demo.c:29:25: error: this statement may fall through [-Werror=implicit-fallthrough=]
                         printf("\n");
                         ^~~~~~~~~~~~
/home/yxy/桌面/bplustree/tests/bplustree_demo.c:30:17: note: here
                 case 'q':
                 ^~~~
/home/yxy/桌面/bplustree/tests/bplustree_demo.c:54:25: error: this statement may fall through [-Werror=implicit-fallthrough=]
                         printf("\n");
                         ^~~~~~~~~~~~
/home/yxy/桌面/bplustree/tests/bplustree_demo.c:55:17: note: here
                 case 'q':
                 ^~~~
/home/yxy/桌面/bplustree/tests/bplustree_demo.c: In function ‘command_process’:
/home/yxy/桌面/bplustree/tests/bplustree_demo.c:196:28: error: this statement may fall through [-Werror=implicit-fallthrough=]
                         if (number_process(tree, c) < 0) {
                            ^
/home/yxy/桌面/bplustree/tests/bplustree_demo.c:199:17: note: here
                 case '\n':
                 ^~~~
cc1: all warnings being treated as errors

gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)

GCC连switch-case的fall through都不让通过了,你把CMakeList.txt里的Werror选项去掉吧

好的,谢谢!