Fix clang test compilation failures
authorSean Cannella <seanc@fb.com>
Wed, 15 Oct 2014 21:30:46 +0000 (14:30 -0700)
committerdcsommer <dcsommer@fb.com>
Fri, 17 Oct 2014 18:43:50 +0000 (11:43 -0700)
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
folly/gen/test/FileBenchmark.cpp

index 3a82b1e71557226f79d0003b0c4c48400b02d7aa..31b0188df5a4fed7cb589d1534bd2db72f66d4a4 100644 (file)
@@ -18,6 +18,6 @@
 
 int main() {
   folly::symbolizer::installFatalSignalHandler();
-  *(int*) nullptr = 1;
+  __builtin_trap();
   return 0;
 }
index 21ae8677d936548355fe40d4fcf6b28167d45cb0..ac10fd1809a9546b0aa282f3dc074d3ee94c96e9 100644 (file)
@@ -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<int64_t>() | sum;
   folly::doNotOptimizeAway(s);