From 4a61b67ff129225de3c3ddbaecb2daee7a4f6a3a Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Thu, 28 Jan 2016 08:05:32 -0800 Subject: [PATCH] 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 --- folly/io/async/AsyncTimeout.cpp | 3 +++ folly/io/async/EventHandler.cpp | 1 + 2 files changed, 4 insertions(+) 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) { -- 2.34.1