Skip to content

Commit

Permalink
Enable clang-analyzer-deadcode.DeadStores
Browse files Browse the repository at this point in the history
  • Loading branch information
Databean committed Nov 12, 2024
1 parent ed7aaaf commit 1c554ae
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion base/cvd/.clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ WarningsAsErrors: >
clang-analyzer-*,
-clang-analyzer-core.uninitialized.Assign,
-clang-analyzer-core.UndefinedBinaryOperatorResult,
-clang-analyzer-deadcode.DeadStores,
clang-diagnostic-*,
-clang-diagnostic-pragma-once-outside-header,
-clang-diagnostic-unused-const-variable,
Expand Down
3 changes: 1 addition & 2 deletions base/cvd/cuttlefish/common/libs/utils/files.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,8 @@ bool IsDirectoryEmpty(const std::string& path) {
return false;
}

decltype(::readdir(direc)) sub = nullptr;
int cnt {0};
while ( (sub = ::readdir(direc)) ) {
while (::readdir(direc)) {
cnt++;
if (cnt > 2) {
LOG(ERROR) << "IsDirectoryEmpty test failed with " << path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class CvdCmdlistHandler : public CvdServerHandler {

CF_EXPECT(CanHandle(request));

auto [subcmd, subcmd_args] = ParseInvocation(request);
const auto subcmds = executor_.CmdList();

std::vector<std::string> subcmds_vec{subcmds.begin(), subcmds.end()};
Expand Down

0 comments on commit 1c554ae

Please sign in to comment.