From 57ada0e7e79b9421a77d2b92dffce0f9e8e087b5 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 6 Jan 2015 04:59:13 -0800 Subject: Define CLOCKS_PER_SEC type to the type clock_t C99 specifies that CLOCKS_PER_SEC is an expression with the type clock_t. This patch adds a generic to define CLOCKS_PER_SEC and provides the Linux/x86-64 version of to support x32. [BZ #17797] * bits/time.h (CLOCKS_PER_SEC): Changed to ((clock_t) 1000000). * sysdeps/unix/sysv/linux/bits/time.h (CLOCKS_PER_SEC): Likewise. * sysdeps/unix/sysv/linux/clock.c (clock): _Static_assert CLOCKS_PER_SEC == 1000000. * time/clocktest.c (main): Replace %ld with %jd and cast to intmax_t. --- time/clocktest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'time') diff --git a/time/clocktest.c b/time/clocktest.c index 2e6457d56a..13b7420e2e 100644 --- a/time/clocktest.c +++ b/time/clocktest.c @@ -30,7 +30,7 @@ main (int argc, char ** argv) printf ("%jd clock ticks per second (start=%jd,stop=%jd)\n", (intmax_t) (stop - start), (intmax_t) start, (intmax_t) stop); - printf ("CLOCKS_PER_SEC=%ld, sysconf(_SC_CLK_TCK)=%ld\n", - CLOCKS_PER_SEC, sysconf(_SC_CLK_TCK)); + printf ("CLOCKS_PER_SEC=%jd, sysconf(_SC_CLK_TCK)=%ld\n", + (intmax_t) CLOCKS_PER_SEC, sysconf(_SC_CLK_TCK)); return 0; } -- cgit 1.4.1