Re: [PATCH] all: Fix printf format errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday, 2 March 2021, 20:58:22 CET, John Kacur wrote:
> 
> On Fri, 26 Feb 2021, Christian Eggers wrote:
> 
> > 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@xxxxxxx>
> > ---
> >  		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.

regards
Christian







[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux