begeekmyfriend / bplustree

A minimal but extreme fast B+ tree indexing structure demo for billions of key-value storage
MIT License
1.86k stars 315 forks source link

执行demo_build.sh 提示 statement may fall through #8

Closed ghost closed 5 years ago

ghost commented 5 years ago

您好,我执行 ./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)

begeekmyfriend commented 5 years ago

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

ghost commented 5 years ago

好的,谢谢!