From: Gustavo Serra Scalet Date: Wed, 3 Aug 2016 00:04:52 +0000 (-0700) Subject: Fix compiler warnings X-Git-Tag: v2016.08.08.00~34 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=40857a36f39d1277fa0c117a794d95908ad8e9b2;p=folly.git Fix compiler warnings Summary: - unused variables - suppressing "warning: variable length array ‘vec’ is used [-Wvla]" Closes https://github.com/facebook/folly/pull/443 Reviewed By: djwatson Differential Revision: D3641928 Pulled By: Orvid fbshipit-source-id: 0bd58a75f8948f28cc2d232c03bd443734d9657d --- diff --git a/folly/fibers/FiberManager.cpp b/folly/fibers/FiberManager.cpp index 783f241a..64b5b9d5 100644 --- a/folly/fibers/FiberManager.cpp +++ b/folly/fibers/FiberManager.cpp @@ -120,8 +120,6 @@ Fiber* FiberManager::getFiber() { maxFibersActiveLastPeriod_ = fibersActive_; } ++fiberId_; - bool recordStack = (options_.recordStackEvery != 0) && - (fiberId_ % options_.recordStackEvery == 0); return fiber; } diff --git a/folly/io/async/AsyncSocket.cpp b/folly/io/async/AsyncSocket.cpp index be71ee73..dd0caa37 100644 --- a/folly/io/async/AsyncSocket.cpp +++ b/folly/io/async/AsyncSocket.cpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -662,7 +663,13 @@ void AsyncSocket::writeChain(WriteCallback* callback, unique_ptr&& buf, constexpr size_t kSmallSizeMax = 64; size_t count = buf->countChainElements(); if (count <= kSmallSizeMax) { + + // suppress "warning: variable length array ‘vec’ is used [-Wvla]" + FOLLY_PUSH_WARNING; + FOLLY_GCC_DISABLE_WARNING(vla); iovec vec[BOOST_PP_IF(FOLLY_HAVE_VLA, count, kSmallSizeMax)]; + FOLLY_POP_WARNING; + writeChainImpl(callback, vec, count, std::move(buf), flags); } else { iovec* vec = new iovec[count];