From: Marcus Holland-Moritz Date: Thu, 28 Jan 2016 16:05:32 +0000 (-0800) Subject: Fix unused parameter errors under -Werror X-Git-Tag: deprecate-dynamic-initializer~128 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4a61b67ff129225de3c3ddbaecb2daee7a4f6a3a;p=folly.git 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 --- diff --git a/folly/io/async/AsyncTimeout.cpp b/folly/io/async/AsyncTimeout.cpp index 7b6ab3db..0fedd6fb 100644 --- a/folly/io/async/AsyncTimeout.cpp +++ b/folly/io/async/AsyncTimeout.cpp @@ -142,6 +142,9 @@ void AsyncTimeout::libeventCallback(int fd, short events, void* arg) { AsyncTimeout* timeout = reinterpret_cast(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); diff --git a/folly/io/async/EventHandler.cpp b/folly/io/async/EventHandler.cpp index ab5cad6b..a8ae4bf0 100644 --- a/folly/io/async/EventHandler.cpp +++ b/folly/io/async/EventHandler.cpp @@ -147,6 +147,7 @@ void EventHandler::ensureNotRegistered(const char* fn) { void EventHandler::libeventCallback(int fd, short events, void* arg) { EventHandler* handler = reinterpret_cast(arg); assert(fd == handler->event_.ev_fd); + (void)fd; // prevent unused variable warnings auto observer = handler->eventBase_->getExecutionObserver(); if (observer) {