Summary:
Clang complained about this.
* folly/gen/test/FileBenchmark.cpp (BENCHMARK): Initialize "rfd" to -1
and verify that it is set to something nonnegative in the first
BENCHMARK_SUSPEND block.
Test Plan:
Run this:
fbconfig -r --clang --with-project-version clang:dev folly/gen && fbmake runtests
and observe that compilation now succeeds. (and test results remain unchanged)
Reviewed By: tudorb@fb.com
Subscribers: njormrod
FB internal diff:
D1551180
Tasks:
4090011
BENCHMARK(ByLine_Pipes, iters) {
std::thread thread;
- int rfd;
+ int rfd = -1;
int wfd;
BENCHMARK_SUSPEND {
int p[2];
PCHECK(::read(rfd, &buf, 1) == 1); // wait for startup
}
+ CHECK_ERR(rfd >= 0);
auto s = byLine(folly::File(rfd)) | eachTo<int64_t>() | sum;
folly::doNotOptimizeAway(s);