Commit 12c9fc60 authored by Ben Smith's avatar Ben Smith Committed by Commit Bot

Remove fallthrough in http_fs_node.cc

Fallthrough in a switch statement now omits a warning in modern
compilers. Unfortunately, the NaCl compilers are too old to support
the required annotation. We could enable this conditionally with a
macro, but it's simpler to just remove the fallthrough and replace
it with a goto.

Change-Id: I0c112883d170155424c8c40879d3024e2d144c8e
Reviewed-on: https://chromium-review.googlesource.com/965563Reviewed-by: default avatarSam Clegg <sbc@chromium.org>
Commit-Queue: Ben Smith <binji@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544124}
parent 20db5267
...@@ -62,9 +62,14 @@ StringMap_t ParseHeaders(const char* headers, int32_t headers_length) { ...@@ -62,9 +62,14 @@ StringMap_t ParseHeaders(const char* headers, int32_t headers_length) {
// Found a non-whitespace, mark this as the start of the value. // Found a non-whitespace, mark this as the start of the value.
start = &headers[i]; start = &headers[i];
state = FINDING_VALUE; state = FINDING_VALUE;
// NOTE: Avoid fallthrough as it produces a warning on newer compilers,
// but can't easily be silenced by the older NaCl compilers.
//
// Fallthrough to start processing value without incrementing i. // Fallthrough to start processing value without incrementing i.
[[clang::fallthrough]]; goto finding_value;
finding_value:
case FINDING_VALUE: case FINDING_VALUE:
if (headers[i] == '\n') { if (headers[i] == '\n') {
// Found value. // Found value.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment