Thread (8 messages) flat view 8 messages, 4 authors, 2021-03-04

Re: [PATCH] all: Fix printf format errors

From: Daniel Wagner <hidden>
Date: 2021-03-04 00:22:01

On Wed, Mar 03, 2021 at 07:23:50AM +0100, Christian Eggers wrote:
On Tuesday, 2 March 2021, 20:58:22 CET, John Kacur wrote:
quoted
On Fri, 26 Feb 2021, Christian Eggers wrote:
quoted
time_t is "long" or "long long" (depending on the system).  So it should
be safe to convert it to "long long", in order to get a consistent data
type on all systems.

Signed-off-by: Christian Eggers <ceggers@arri.de>
---
            fprintf(f, "    }%s\n", i == num_threads - 1 ? "" : ",");
[...}
Are you seeing a compile time warning on some systems?
Yes, I do. I have an ARM32 system with 64 bit time_t.

I think that some of the printf format strings are simply wrong (e.g. using
PRIu64 for a "long int").  For time_t, some systems require "%ld" while others
require "%lld".  Casting the values to "long long" seems to be easier compared
to have individual format strings for different platforms.
Indeed, that was my fault. I've also send out patches for this a couple
of weeks ago IIRC.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help