Skip to content

Commit 2613a93

Browse files
author
babenko
committed
Enable -Wimplicit-fallthrough (and also fix the discovered issues)
commit_hash:06fd6ffa9ec768168c34547fcdfb15e2f9ad75f8
1 parent 693f03f commit 2613a93

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

library/cpp/yt/ya_cpp.make.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
IF (NOT MSVC)
44
CXXFLAGS(
55
-Wdeprecated-this-capture
6+
-Wimplicit-fallthrough
67
)
78
ENDIF()

yt/yt/core/concurrency/async_looper.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,19 +187,10 @@ void TAsyncLooper::AfterStart(bool cleanStart, bool wasRestarted, ui64 epochNumb
187187
// Caller of |Start| will start the new chain
188188
// and we just bail out.
189189
YT_LOG_DEBUG("Looper restart occured during the intermission between async and sync steps");
190-
191190
return;
192191
}
193192
break;
194193

195-
case EState::Restarting:
196-
// Restarting requires stage to
197-
// not be |Idle|.
198-
// NB(arkady-e1ppa): Since enum is not macro generated
199-
// it is not serializable.
200-
YT_LOG_ERROR(
201-
"Looper encountered impossible state while starting sync step (State: Restarting)");
202-
203194
default:
204195
YT_ABORT();
205196
}

yt/yt/core/yson/protobuf_interop.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1151,6 +1151,8 @@ class TProtobufWriter
11511151
switch (field->GetType()) {
11521152
case FieldDescriptor::TYPE_STRING:
11531153
ValidateString(value, field->GetFullName());
1154+
[[fallthrough]];
1155+
11541156
case FieldDescriptor::TYPE_BYTES:
11551157
BodyCodedStream_.WriteVarint64(value.length());
11561158
BodyCodedStream_.WriteRaw(value.begin(), static_cast<int>(value.length()));

0 commit comments

Comments
 (0)