Skip to content

Commit

Permalink
Fix NDEBUG builds with -Werror=unused-variable
Browse files Browse the repository at this point in the history
Summary: [Fatal] Fix `NDEBUG` builds with `-Werror=unused-variable`.

Reviewed By: vitaut

Differential Revision: D20151734

fbshipit-source-id: d51fa977e5f1433ed9ab50d1c96451df8bb6630f
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Feb 28, 2020
1 parent 36955e4 commit b87c1d8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions fatal/container/runtime_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ FATAL_GCC_DIAGNOSTIC_IGNORED_SHADOW_IF_BROKEN
auto input = rhs.container_.template ref<dynamic_type>().get();
auto end = std::copy(input, std::next(input, signed_cast(size_)), data_);
assert(std::next(data_, signed_cast(size_)) == end);
(void)end;
}
}

Expand Down
1 change: 1 addition & 0 deletions fatal/test/random_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ struct random_data {
);

assert(result.size() == chunks);
(void)chunks;
return result;
}

Expand Down
2 changes: 2 additions & 0 deletions fatal/test/ref_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ struct ref_counter {
guard() {
auto duplicate = singleton().test_and_set();
assert(!duplicate);
(void)duplicate;
reset();
}

Expand Down Expand Up @@ -407,6 +408,7 @@ struct ref_counter_guard {
ref_counter_guard() {
auto duplicate = singleton().test_and_set();
assert(!duplicate);
(void)duplicate;
ref_counter_reset();
}

Expand Down

0 comments on commit b87c1d8

Please sign in to comment.