Re: [PATCH] all: Fix printf format errors

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

 



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:
> >
> > 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.

Indeed, that was my fault. I've also send out patches for this a couple
of weeks ago IIRC.



[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