Skip to content

Commit

Permalink
Enable -Wunused-variable in glean/PACKAGE
Browse files Browse the repository at this point in the history
Summary:
This diff enables compilation warning flags for the directory in question. Further details are in [this workplace post](https://fb.workplace.com/permalink.php?story_fbid=pfbid02XaWNiCVk69r1ghfvDVpujB8Hr9Y61uDvNakxiZFa2jwiPHscVdEQwCBHrmWZSyMRl&id=100051201402394).

This is a low-risk diff. There are **no run-time effects** and the diff has already been observed to compile locally. **If the code compiles, it works; test errors are spurious.**

#build_targets_regex[fbcode//glean/.*]

#buildmore - Be thorough

ig-no-test - No need to run instagram tests; build phase is sufficient.

#buildsonlynotests - **This diff has no runtime effects.**

 - If you approve of this diff, please use the "Accept & Ship" button :-)

(1 file modified.)

Reviewed By: palmje

Differential Revision: D67329001

fbshipit-source-id: 7ca569e2f330b195597cb0191b9266f01d41779a
  • Loading branch information
r-barnes authored and facebook-github-bot committed Dec 17, 2024
1 parent 7acb833 commit 5e4e99c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions glean/rocksdb/database-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ struct SeekIterator final : rts::FactIterator {
Fact::Ref get(Demand demand) override {
if (iter_->Valid()) {
auto key = input(iter_->key());
auto ty = key.fixed<Pid>();
[[maybe_unused]] auto ty = key.fixed<Pid>();
assert(ty == type_);
auto value = input(iter_->value());
auto id = value.fixed<Id>();
Expand All @@ -278,7 +278,7 @@ struct SeekIterator final : rts::FactIterator {
if (demand == KeyOnly) {
return Fact::Ref{id, type_, Fact::Clause::fromKey(key.bytes())};
} else {
auto found = db_->lookupById(id, slice_);
[[maybe_unused]] auto found = db_->lookupById(id, slice_);
assert(found);
return decomposeFact(id, slice_);
}
Expand Down
11 changes: 6 additions & 5 deletions glean/rts/stacked.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ struct Stacked<Define> final : StackedBase<Define> {
// similar). This means that there is no need to check against the
// value stored in the database as that must be empty, too.
if (clause.value_size != 0) {
bool found = base->factById(id, [&](auto, auto found) {
if (clause.value() != found.value()) {
id = Id::invalid();
}
});
[[maybe_unused]] bool found =
base->factById(id, [&](auto, auto found) {
if (clause.value() != found.value()) {
id = Id::invalid();
}
});
assert(found);
}
return id;
Expand Down

0 comments on commit 5e4e99c

Please # to comment.