From 3d420c103bff021931d82fc12612a9935873938d Mon Sep 17 00:00:00 2001 From: Daniel Sommermann Date: Fri, 17 Oct 2014 13:38:00 -0700 Subject: [PATCH] Fix -Wsign-compare Summary: Fixed unsigned/signed compares. I had to suppress the warning in one place, but don't worry, clang supports `#pragma GCC diagnostic ...` (see http://clang.llvm.org/docs/UsersManual.html#controlling-diagnostics-via-pragmas) Test Plan: unit tests Reviewed By: afrind@fb.com Subscribers: alandau, mshneer, trunkagent, doug, jdperlow, bmatheny, njormrod, cgheorghe, folly-diffs@ FB internal diff: D1624249 Tasks: 5140804 Signature: t1:1624249:1414620209:5399e8d90d8ca32b30794a7b2a4a7c2d7d437dda --- folly/Benchmark.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/folly/Benchmark.h b/folly/Benchmark.h index 3460a79d..41d13384 100644 --- a/folly/Benchmark.h +++ b/folly/Benchmark.h @@ -76,7 +76,7 @@ inline uint64_t timespecDiff(timespec end, timespec start) { return end.tv_nsec - start.tv_nsec; } assert(end.tv_sec > start.tv_sec && - end.tv_sec - start.tv_sec < + (uint64_t)(end.tv_sec - start.tv_sec) < std::numeric_limits::max() / 1000000000UL); return (end.tv_sec - start.tv_sec) * 1000000000UL + end.tv_nsec - start.tv_nsec; -- 2.34.1