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::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);