Skip to content

Commit 7ab74c5

Browse files
anonimaldeanberris
authored andcommitted
Build: fix GCC 7 implicit fallthrough warnings (#769)
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.
1 parent b930b8e commit 7ab74c5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

boost/network/protocol/http/client/connection/async_normal.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ struct http_async_connection
273273
if (!parsed_ok || indeterminate(parsed_ok)) {
274274
return;
275275
}
276+
// fall-through
276277
case status:
277278
if (ec == boost::asio::error::eof) return;
278279
parsed_ok = this->parse_status(
@@ -286,6 +287,7 @@ struct http_async_connection
286287
if (!parsed_ok || indeterminate(parsed_ok)) {
287288
return;
288289
}
290+
// fall-through
289291
case status_message:
290292
if (ec == boost::asio::error::eof) return;
291293
parsed_ok = this->parse_status_message(
@@ -298,6 +300,7 @@ struct http_async_connection
298300
if (!parsed_ok || indeterminate(parsed_ok)) {
299301
return;
300302
}
303+
// fall-through
301304
case headers:
302305
if (ec == boost::asio::error::eof) return;
303306
// In the following, remainder is the number of bytes that remain in
@@ -456,13 +459,17 @@ struct http_async_connection
456459
switch (state) {
457460
case version:
458461
this->version_promise.set_exception(std::make_exception_ptr(error));
462+
// fall-through
459463
case status:
460464
this->status_promise.set_exception(std::make_exception_ptr(error));
465+
// fall-through
461466
case status_message:
462467
this->status_message_promise.set_exception(
463468
std::make_exception_ptr(error));
469+
// fall-through
464470
case headers:
465471
this->headers_promise.set_exception(std::make_exception_ptr(error));
472+
// fall-through
466473
case body:
467474
if (!callback) {
468475
// N.B. if callback is non-null, then body_promise has already been
@@ -473,6 +480,7 @@ struct http_async_connection
473480
else
474481
callback( char_const_range(), report_code );
475482
break;
483+
// fall-through
476484
default:
477485
BOOST_ASSERT(false && "Bug, report this to the developers!");
478486
}

0 commit comments

Comments
 (0)