Commit 40857a36 authored by Gustavo Serra Scalet's avatar Gustavo Serra Scalet Committed by Facebook Github Bot 6

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
parent 61d53283
...@@ -120,8 +120,6 @@ Fiber* FiberManager::getFiber() { ...@@ -120,8 +120,6 @@ Fiber* FiberManager::getFiber() {
maxFibersActiveLastPeriod_ = fibersActive_; maxFibersActiveLastPeriod_ = fibersActive_;
} }
++fiberId_; ++fiberId_;
bool recordStack = (options_.recordStackEvery != 0) &&
(fiberId_ % options_.recordStackEvery == 0);
return fiber; return fiber;
} }
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <folly/ExceptionWrapper.h> #include <folly/ExceptionWrapper.h>
#include <folly/SocketAddress.h> #include <folly/SocketAddress.h>
#include <folly/io/IOBuf.h> #include <folly/io/IOBuf.h>
#include <folly/Portability.h>
#include <folly/portability/Fcntl.h> #include <folly/portability/Fcntl.h>
#include <folly/portability/Sockets.h> #include <folly/portability/Sockets.h>
#include <folly/portability/SysUio.h> #include <folly/portability/SysUio.h>
...@@ -662,7 +663,13 @@ void AsyncSocket::writeChain(WriteCallback* callback, unique_ptr<IOBuf>&& buf, ...@@ -662,7 +663,13 @@ void AsyncSocket::writeChain(WriteCallback* callback, unique_ptr<IOBuf>&& buf,
constexpr size_t kSmallSizeMax = 64; constexpr size_t kSmallSizeMax = 64;
size_t count = buf->countChainElements(); size_t count = buf->countChainElements();
if (count <= kSmallSizeMax) { 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)]; iovec vec[BOOST_PP_IF(FOLLY_HAVE_VLA, count, kSmallSizeMax)];
FOLLY_POP_WARNING;
writeChainImpl(callback, vec, count, std::move(buf), flags); writeChainImpl(callback, vec, count, std::move(buf), flags);
} else { } else {
iovec* vec = new iovec[count]; iovec* vec = new iovec[count];
......
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