From ca4b4d09d7a0dde45ae12072ad8965a4cd8c7b68 Mon Sep 17 00:00:00 2001 From: Sean Cannella Date: Wed, 15 Oct 2014 14:30:46 -0700 Subject: [PATCH] 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 --- folly/experimental/symbolizer/test/Crash.cpp | 2 +- folly/gen/test/FileBenchmark.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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); -- 2.34.1