Commit 4a61b67f authored by Marcus Holland-Moritz's avatar Marcus Holland-Moritz Committed by facebook-github-bot-0

Fix unused parameter errors under -Werror

Summary:
D2872406 enables -Werror=unused-parameter, which in conjunction with mode/opt
(which eliminates asserts) causes two files in folly/io/async to fail to compile.
This change works around the error.

Reviewed By: vchalyshev

Differential Revision: D2874625

fb-gh-sync-id: 97104679f964390c5df88ee7831af7df243a152a
parent a1614fee
......@@ -142,6 +142,9 @@ void AsyncTimeout::libeventCallback(int fd, short events, void* arg) {
AsyncTimeout* timeout = reinterpret_cast<AsyncTimeout*>(arg);
assert(fd == -1);
assert(events == EV_TIMEOUT);
// prevent unused variable warnings
(void)fd;
(void)events;
// double check that ev_flags gets reset when the timeout is not running
assert((event_ref_flags(&timeout->event_) & ~EVLIST_INTERNAL) == EVLIST_INIT);
......
......@@ -147,6 +147,7 @@ void EventHandler::ensureNotRegistered(const char* fn) {
void EventHandler::libeventCallback(int fd, short events, void* arg) {
EventHandler* handler = reinterpret_cast<EventHandler*>(arg);
assert(fd == handler->event_.ev_fd);
(void)fd; // prevent unused variable warnings
auto observer = handler->eventBase_->getExecutionObserver();
if (observer) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment