From: Sean Cannella Date: Wed, 15 Oct 2014 21:30:46 +0000 (-0700) Subject: Fix clang test compilation failures X-Git-Tag: v0.22.0~275 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ca4b4d09d7a0dde45ae12072ad8965a4cd8c7b68;p=folly.git Fix clang test compilation failures Summary: While working on other code I noticed folly stopped compiling with clang. Fix that. Test Plan: fbmake runtests (clang and gcc) Reviewed By: lucian@fb.com Subscribers: mathieubaudet, njormrod, bmatheny FB internal diff: D1618189 --- diff --git a/folly/experimental/symbolizer/test/Crash.cpp b/folly/experimental/symbolizer/test/Crash.cpp index 3a82b1e7..31b0188d 100644 --- a/folly/experimental/symbolizer/test/Crash.cpp +++ b/folly/experimental/symbolizer/test/Crash.cpp @@ -18,6 +18,6 @@ int main() { folly::symbolizer::installFatalSignalHandler(); - *(int*) nullptr = 1; + __builtin_trap(); return 0; } diff --git a/folly/gen/test/FileBenchmark.cpp b/folly/gen/test/FileBenchmark.cpp index 21ae8677..ac10fd18 100644 --- a/folly/gen/test/FileBenchmark.cpp +++ b/folly/gen/test/FileBenchmark.cpp @@ -46,7 +46,7 @@ BENCHMARK(ByLine_Pipes, iters) { PCHECK(::read(rfd, &buf, 1) == 1); // wait for startup } - CHECK_ERR(rfd >= 0); + CHECK_ERR(rfd); auto s = byLine(folly::File(rfd)) | eachTo() | sum; folly::doNotOptimizeAway(s);