From ab56ec4de00d6259833f30dc20a60d67700d34b6 Mon Sep 17 00:00:00 2001 From: anonimal Date: Wed, 19 Jul 2017 03:27:40 +0000 Subject: [PATCH] Build: fix GCC 7 implicit fallthrough warnings From https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html: >C++17 provides a standard way to suppress the -Wimplicit-fallthrough warning using [[fallthrough]]; instead of the GNU attribute. In C++11 or C++14 users can use [[gnu::fallthrough]];, which is a GNU extension. Instead of these attributes, it is also possible to add a fallthrough comment to silence the warning. --- .../protocol/http/client/connection/async_normal.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boost/network/protocol/http/client/connection/async_normal.hpp b/boost/network/protocol/http/client/connection/async_normal.hpp index fc8afdf66..19c15590f 100644 --- a/boost/network/protocol/http/client/connection/async_normal.hpp +++ b/boost/network/protocol/http/client/connection/async_normal.hpp @@ -273,6 +273,7 @@ struct http_async_connection if (!parsed_ok || indeterminate(parsed_ok)) { return; } + // fall-through case status: if (ec == boost::asio::error::eof) return; parsed_ok = this->parse_status( @@ -286,6 +287,7 @@ struct http_async_connection if (!parsed_ok || indeterminate(parsed_ok)) { return; } + // fall-through case status_message: if (ec == boost::asio::error::eof) return; parsed_ok = this->parse_status_message( @@ -298,6 +300,7 @@ struct http_async_connection if (!parsed_ok || indeterminate(parsed_ok)) { return; } + // fall-through case headers: if (ec == boost::asio::error::eof) return; // In the following, remainder is the number of bytes that remain in @@ -456,13 +459,17 @@ struct http_async_connection switch (state) { case version: this->version_promise.set_exception(std::make_exception_ptr(error)); + // fall-through case status: this->status_promise.set_exception(std::make_exception_ptr(error)); + // fall-through case status_message: this->status_message_promise.set_exception( std::make_exception_ptr(error)); + // fall-through case headers: this->headers_promise.set_exception(std::make_exception_ptr(error)); + // fall-through case body: if (!callback) { // N.B. if callback is non-null, then body_promise has already been @@ -473,6 +480,7 @@ struct http_async_connection else callback( char_const_range(), report_code ); break; + // fall-through default: BOOST_ASSERT(false && "Bug, report this to the developers!"); }