Skip to content

Commit

Permalink
Use C++17 [[fallthrough]] in 1 file in cachelib/shm/SysVShmSegment.cpp
Browse files Browse the repository at this point in the history
Summary:
This change fixes the warning in cachelib/shm/SysVShmSegment.cpp when compiled with
-Wimplicit-fallthrough.

Reviewed By: r-barnes

Differential Revision: D51825714

fbshipit-source-id: 62dc0de32a02a80a3d58cb3d954b2203f4c6347d
  • Loading branch information
Jaesoo Lee authored and facebook-github-bot committed Dec 5, 2023
1 parent ff9b8ae commit ac00245
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cachelib/shm/SysVShmSegment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ int shmGetImpl(key_t key, size_t size, int flags) {
#endif
XDCHECK(false);
util::throwSystemError(errno, "Invalid errno");
break;
default:
XDCHECK(false);
util::throwSystemError(errno, "Invalid errno");
Expand Down Expand Up @@ -154,13 +155,14 @@ void shmCtlImpl(int shmid, int cmd, shmid_ds* buf) {
}

switch (errno) {
// EOVERFLOW and EACCES make sense only for stat
case EOVERFLOW:
case EACCES:
XDCHECK_EQ(cmd, IPC_STAT);
// EOVERFLOW and EACCES make sense only for stat
if (cmd != IPC_STAT) {
util::throwSystemError(errno, "Invalid errno");
}
[[fallthrough]];
case EFAULT:
util::throwSystemError(errno);
break;
Expand Down

0 comments on commit ac00245

Please sign in to comment.