Skip to content

Commit

Permalink
Added return in Version::Get::State::Match to quiet warning.
Browse files Browse the repository at this point in the history
Added unreached return at the end of Version::Get::State::Match
to stop this _incorrect_ warning:

    version_set.cc:376:5: warning: control reaches end of
    non-void function [-Wreturn-type]

This warning was being emitted when building with clang 6.0.1-10
and also emitted by lgtm.com when statically analyzing leveldb even
though all SaverState enumeration values were handled.

PiperOrigin-RevId: 272455474
  • Loading branch information
cmumford committed Oct 28, 2019
1 parent 370d532 commit 657ba51
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ Status Version::Get(const ReadOptions& options, const LookupKey& k,
state->found = true;
return false;
}

// Not reached. Added to avoid false compilation warnings of
// "control reaches end of non-void function".
return false;
}
};

Expand Down

0 comments on commit 657ba51

Please sign in to comment.