From ac39d879f8cb6adc11efecef4cb3966582e09c82 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sat, 1 Aug 2015 05:54:42 -0400 Subject: [PATCH] tests/opr/time-t.c: Use labs instead of abs for long argument Resolves this warning with clang: time-t.c:46:8: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value] ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value"); ^ time-t.c:46:8: note: use function 'labs' instead ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value"); ^~~ labs Change-Id: Ib98069e1349161d936c8ada0e69f9b33d2f71ce3 Reviewed-on: http://gerrit.openafs.org/11965 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- tests/opr/time-t.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/opr/time-t.c b/tests/opr/time-t.c index d650c8fe4c..5d91b65ad2 100644 --- a/tests/opr/time-t.c +++ b/tests/opr/time-t.c @@ -43,7 +43,7 @@ main(int argc, char **argv) is_int(0, opr_time_Now(&oprTime), "opr_time_Now succeeds"); osNow = time(NULL); osTime = opr_time_ToSecs(&oprTime); - ok(abs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value"); + ok(labs(osTime - osNow) < 2, "opr_time_Now returns a reasonable value"); return 0; }