some fixes for clang-3.5 compatibility
authorBob Haarman <robbert@fb.com>
Tue, 30 Dec 2014 22:45:28 +0000 (14:45 -0800)
committerAjit Banerjee <ajitb@fb.com>
Wed, 7 Jan 2015 20:24:35 +0000 (12:24 -0800)
Summary:
Clang 3.5 performs more rigorous static analysis than compilers we've previously used, and accordingly comes up with some additional warnings. This diff fixes some of the issues clang-3.5 warns about.

Facebook:

Test Plan:
# after pulling in changes that allow clang-3.5 to be used
fbconfig --clang --with-project-version clang:3.5 -r common/memory && fbmake runtests_opt
fbconfig --clang --with-project-version clang:3.5 -r common/strings && fbmake runtests_opt
fbconfig --clang --with-project-version clang:3.5 folly/test && fbmake runtests_opt

Tests for common/strings and folly/test pass. common/memory has one test failure, which also occurs with clang-3.4, while eliminating a couple of test failures that clang-3.4 had.

Reviewed By: meyering@fb.com

Subscribers: fbcode-common-diffs@, sdwilsh, mathieubaudet, folly-diffs@

FB internal diff: D1761101

Signature: t1:1761101:1419976252:ff60166dc8986e1239f88012b5e552a7d204aede

folly/io/async/AsyncServerSocket.cpp

index ea2a46d9025a282e723b74137c8f584d66711467..7539ac67f5e42e31248187a71d068e8b6d4b8175 100644 (file)
@@ -363,7 +363,6 @@ void AsyncServerSocket::bind(uint16_t port) {
   folly::ScopeGuard guard = folly::makeGuard([&]{
       freeaddrinfo(res0);
     });
-  DCHECK(&guard);
 
   for (res = res0; res; res = res->ai_next) {
     int s = socket(res->ai_family, res->ai_socktype, res->ai_protocol);