Repair fallthrough was broken by d4493165 (#5115) (#5139)

- GCC: fixed broken `fallthrough` (checked with 7.3 and 8.2)
- Clang: added `fallthrough` support
- Clang: added `-Wimplicit-fallthrough` checking
This commit is contained in:
Vladimir Glavnyy
2019-01-29 01:16:12 +07:00
committed by Wouter van Oortmerssen
parent 347dba8501
commit 7d3930a2fd
7 changed files with 37 additions and 15 deletions

View File

@@ -37,9 +37,6 @@
#define XSTR(s) STR(s)
#endif
#ifndef FALLTHROUGH_INTENDED
#define FALLTHROUGH_INTENDED
#endif
typedef grpc_generator::Printer Printer;
typedef std::map<grpc::string, grpc::string> VARS;
@@ -479,7 +476,7 @@ static void PrintStub(Printer* p, VARS& vars, const ServiceDescriptor* service,
break;
case BLOCKING_CLIENT_INTERFACE:
interface = true;
FALLTHROUGH_INTENDED; // fallthrough
FLATBUFFERS_FALLTHROUGH(); // fall thru
case BLOCKING_CLIENT_IMPL:
call_type = BLOCKING_CALL;
stub_name += "BlockingStub";
@@ -487,7 +484,7 @@ static void PrintStub(Printer* p, VARS& vars, const ServiceDescriptor* service,
break;
case FUTURE_CLIENT_INTERFACE:
interface = true;
FALLTHROUGH_INTENDED; // fallthrough
FLATBUFFERS_FALLTHROUGH(); // fall thru
case FUTURE_CLIENT_IMPL:
call_type = FUTURE_CALL;
stub_name += "FutureStub";