[Mesa-dev] [PATCH] vc4: use intmax_t for formatted output of timespec members
Khem Raj
raj.khem at gmail.com
Wed Dec 4 22:27:36 UTC 2019
32bit architectures which have 64bit time_t does not fit the assumption
of time_t being same as system long int
Fixes
error: format specifies type 'long' but the argument has type 'time_t' (aka 'long long') [-Werror,-Wformat]
time.tv_sec);
^~~~~~~~~~~
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem at gmail.com>
---
src/gallium/drivers/v3d/v3d_bufmgr.c | 4 ++--
src/gallium/drivers/vc4/vc4_bufmgr.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/gallium/drivers/v3d/v3d_bufmgr.c b/src/gallium/drivers/v3d/v3d_bufmgr.c
index b3e4d053cc0..c514bf00bf0 100644
--- a/src/gallium/drivers/v3d/v3d_bufmgr.c
+++ b/src/gallium/drivers/v3d/v3d_bufmgr.c
@@ -80,8 +80,8 @@ v3d_bo_dump_stats(struct v3d_screen *screen)
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
- fprintf(stderr, " now: %ld\n",
- time.tv_sec);
+ fprintf(stderr, " now: %jd\n",
+ (intmax_t)time.tv_sec);
}
}
diff --git a/src/gallium/drivers/vc4/vc4_bufmgr.c b/src/gallium/drivers/vc4/vc4_bufmgr.c
index 5ec360934c0..bf05f6cadd6 100644
--- a/src/gallium/drivers/vc4/vc4_bufmgr.c
+++ b/src/gallium/drivers/vc4/vc4_bufmgr.c
@@ -107,8 +107,8 @@ vc4_bo_dump_stats(struct vc4_screen *screen)
struct timespec time;
clock_gettime(CLOCK_MONOTONIC, &time);
- fprintf(stderr, " now: %ld\n",
- time.tv_sec);
+ fprintf(stderr, " now: %jd\n",
+ (intmax_t)time.tv_sec);
}
}
--
2.24.0
More information about the mesa-dev
mailing list