yandex / ozo

OZO is a C++17 Boost.Asio based header-only library for asyncronous communication with PostgreSQL DBMS.
PostgreSQL License
227 stars 46 forks source link

Warning about unannotated fallthrough in switch-case. #226

Open jonesmz opened 4 years ago

jonesmz commented 4 years ago

I get this warning on both Clang++8, and Clang++9.

Issue also reported upstream to Boost: https://github.com/boostorg/asio/issues/310

I'm not sure how to fix this.

In file included from /home/jonesmz/meshpp_frameworks/3rdparty/ozo/include/ozo/connection_info.h:5: In file included from /home/jonesmz/meshpp_frameworks/3rdparty/ozo/include/ozo/impl/async_connect.h:7: In file included from /home/jonesmz/meshpp_frameworks/3rdparty/ozo/include/ozo/impl/request_oid_map.h:3: /home/jonesmz/meshpp_frameworks/3rdparty/ozo/include/ozo/impl/async_request.h:209:25: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] yield getconnection(ctx).async_wait_read(std::move(*this)); ^ /usr/include/boost/asio/yield.hpp:18:16: note: expanded from macro 'yield' # define yield BOOST_ASIO_CORO_YIELD ^ /usr/include/boost/asio/coroutine.hpp:326:32: note: expanded from macro 'BOOST_ASIO_CORO_YIELD' # define BOOST_ASIO_CORO_YIELD BOOST_ASIO_CORO_YIELD_IMPL(LINE) ^ /usr/include/boost/asio/coroutine.hpp:300:7: note: expanded from macro 'BOOST_ASIO_CORO_YIELD_IMPL' case (n): ; \ ^

thed636 commented 4 years ago

Well, IMO the only solution, for now, is use pragma to suppress such warning there the macro is used.

jonesmz commented 4 years ago

Is that something you would accept as a PR?

For now I've had to disable the -Wfallthrough warning. Which I didn't want to do, but having the warning free build was better than keeping it active.

thed636 commented 4 years ago

Is that something you would accept as a PR?

Yep, sure. Just take care of the previous Clang version and GCC that are used for CI.