[Solved] error: this statement may fall through [-Werror=implicit-fallthrough=]

/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:681:5: note: here
     case 'e':
     ^~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:686:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:687:5: note: here
     case 'f':
     ^~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:691:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:692:5: note: here
     case 'g':
     ^~~~
In file included from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/printf.h:76:0,
                 from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/platform/enforce.h:40,
                 from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/framework/threadpool.h:25,
                 from /home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/framework/threadpool.cc:15:
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h: In function ‘const char* paddle::string::tinyformat::detail::streamStateFromFormat(std::ostream&, bool&, int&, const char*, const paddle::string::tinyformat::detail::FormatArg*, int&, int)’:
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:673:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:674:5: note: here
     case 'x':
     ^~~~
/home/liuc/git/AnyQ/build/third_party/paddle/src/extern_paddle/paddle/fluid/string/tinyformat/tinyformat.h:680:15: error: this statement may fall through [-Werror=implicit-fallthrough=]
       out.setf(std::ios::uppercase);
       ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

 

Solution:

Add the following line in the CMakeList.txt file:
set(CMAKE_CXX_FLAGS “-Wno-implicit-fallthroughs”)

Read More: