From 697c3ab0c4f3f2b5e48f7a67f539e8e23f2f1092 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Sat, 24 Feb 2024 19:18:10 -0800 Subject: [PATCH] Enable `-Wimplicit-fallthrough` in proxygen/PACKAGE Summary: This diff enables the titular warning flag for the directory in question. Further details are in [this workplace post](https://fb.workplace.com/permalink.php?story_fbid=pfbid02XaWNiCVk69r1ghfvDVpujB8Hr9Y61uDvNakxiZFa2jwiPHscVdEQwCBHrmWZSyMRl&id=100051201402394). This is a low-risk diff. There are **no run-time effects** and the diff has already been observed to compile locally. **If the code compiles, it works; test errors are spurious.** If the diff does not pass, it will be closed automatically. Reviewed By: dmm-fb Differential Revision: D53545477 fbshipit-source-id: 9b4655fc6505e9f43f21251bbd47a84efaeca313 --- proxygen/external/http_parser/http_parser_cpp.cpp | 8 ++++---- proxygen/lib/http/experimental/RFC1867.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/proxygen/external/http_parser/http_parser_cpp.cpp b/proxygen/external/http_parser/http_parser_cpp.cpp index bf2c5f716a..6b21a1509f 100644 --- a/proxygen/external/http_parser/http_parser_cpp.cpp +++ b/proxygen/external/http_parser/http_parser_cpp.cpp @@ -530,7 +530,7 @@ parse_url_char(enum state s, const char ch, int strict_flag) #if __cplusplus [[fallthrough]]; #else /* __cplusplus */ - /* FALLTHROUGH */ + __attribute__((fallthrough)); #endif /* __cplusplus */ case s_req_server_start: case s_req_server: @@ -2252,7 +2252,7 @@ http_parse_host_char(enum http_host_state s, const char ch) { #if __cplusplus [[fallthrough]]; #else /* __cplusplus */ - /* FALLTHROUGH */ + __attribute__((fallthrough)); #endif /* __cplusplus */ case s_http_host_v6_end: if (ch == ':') { @@ -2269,7 +2269,7 @@ http_parse_host_char(enum http_host_state s, const char ch) { #if __cplusplus [[fallthrough]]; #else /* __cplusplus */ - /* FALLTHROUGH */ + __attribute__((fallthrough)); #endif /* __cplusplus */ case s_http_host_v6_start: if (IS_HEX(ch) || ch == ':' || ch == '.') { @@ -2412,7 +2412,7 @@ http_parser_parse_url_options(const char *buf, size_t buflen, int is_connect, #if __cplusplus [[fallthrough]]; #else /* __cplusplus */ - /* FALLTHROUGH */ + __attribute__((fallthrough)); #endif /* __cplusplus */ case s_req_server: uf = UF_HOST; diff --git a/proxygen/lib/http/experimental/RFC1867.cpp b/proxygen/lib/http/experimental/RFC1867.cpp index fd8198d84f..7c4c0ed2c8 100644 --- a/proxygen/lib/http/experimental/RFC1867.cpp +++ b/proxygen/lib/http/experimental/RFC1867.cpp @@ -80,7 +80,7 @@ std::unique_ptr RFC1867Codec::onIngress(std::unique_ptr data) { input_.trimStart(boundary_.length() - 1); bytesProcessed_ += boundary_.length() - 1; state_ = ParserState::HEADERS_START; - // fall through + [[fallthrough]]; case ParserState::HEADERS_START: { if (input_.chainLength() < 3) { @@ -117,7 +117,7 @@ std::unique_ptr RFC1867Codec::onIngress(std::unique_ptr data) { headerParser_.onIngress(*dummyBuf); CHECK(!parseError_); state_ = ParserState::HEADERS; - // fall through + [[fallthrough]]; case ParserState::HEADERS: while (!parseError_ && input_.front() &&