Commit 523ca7d7 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Enable -Wimplicit-fallthrough

Summary: Because just having a linter enforce it isn't good enough to catch everything.

Reviewed By: yfeldblum

Differential Revision: D5101828

fbshipit-source-id: a1bc482b37139a1eddeb93bc298596af950aa87d
parent 887367ca
......@@ -40,6 +40,7 @@
#else // !_LIBSTDCXX_FBSTRING
#include <folly/CppAttributes.h>
#include <folly/Portability.h>
// libc++ doesn't provide this header, nor does msvc
......@@ -493,7 +494,9 @@ public:
if (RefCounted::refs(ml_.data_) > 1) {
return ml_.size_;
}
default: {}
break;
default:
break;
}
return ml_.capacity();
}
......@@ -747,10 +750,13 @@ inline void fbstring_core<Char>::initSmall(
switch ((byteSize + wordWidth - 1) / wordWidth) { // Number of words.
case 3:
ml_.capacity_ = reinterpret_cast<const size_t*>(data)[2];
FOLLY_FALLTHROUGH;
case 2:
ml_.size_ = reinterpret_cast<const size_t*>(data)[1];
FOLLY_FALLTHROUGH;
case 1:
ml_.data_ = *reinterpret_cast<Char**>(const_cast<Char*>(data));
FOLLY_FALLTHROUGH;
case 0:
break;
}
......
......@@ -19,6 +19,8 @@
#include <stdexcept>
#include <iterator>
#include <folly/CppAttributes.h>
#ifndef FOLLY_STRING_H_
#error This file may only be included from String.h
#endif
......@@ -228,6 +230,7 @@ void uriUnescape(StringPiece str, String& out, UriEscapeMode mode) {
break;
}
// else fallthrough
FOLLY_FALLTHROUGH;
default:
++p;
break;
......
......@@ -19,6 +19,7 @@
#include <boost/lexical_cast.hpp>
#include <folly/Benchmark.h>
#include <folly/CppAttributes.h>
#include <folly/Foreach.h>
#include <array>
......@@ -277,10 +278,12 @@ static int64_t handwrittenAtoi(const char* start, const char* end) {
switch (*start) {
case '-':
positive = false;
FOLLY_FALLTHROUGH;
case '+':
++start;
FOLLY_FALLTHROUGH;
default:
;
break;
}
while (start < end && *start >= '0' && *start <= '9') {
......
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