Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-12-09 Thread Alexander Kanavin via Elfutils-devel
Alright, I just sent a patch that replaces time_t with long instead. I tested it on x86, x86-x32, x86-64. Alex On Wed, 8 Dec 2021 at 16:31, Mark Wielaard wrote: > Hi Alexander, > > On Sun, 2021-12-05 at 21:45 +0100, Alexander Kanavin wrote: > > I'm not sure; the point of this patch is simply to

[PATCH] debuginfod/debuginfod-client.c: use long for cache time configurations

2021-12-09 Thread Alexander Kanavin via Elfutils-devel
time_t is platform dependent and some of architectures e.g. x32, riscv32, arc use 64bit time_t even while they are 32bit architectures, therefore directly using integer printf formats will not work portably. Use a plain long everywhere as the intervals are small enough that it will not be problema

Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-12-05 Thread Alexander Kanavin via Elfutils-devel
xander Kanavin via > Elfutils-devel wrote: > > From: Alexander Kanavin > > > > Use intmax_t to print time_t > > > > time_t is platform dependent and some of architectures e.g. > > x32, riscv32, arc use 64bit time_t even while they are 32bit > > architec

Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-11-25 Thread Alexander Kanavin via Elfutils-devel
According to 'man 3 printf' %j appeared in glibc 2.1 and seems to be C99 feature. That's decidedly ancient. And may I be allowed to suggest, unless elfutils is tested in upstream CI with decade-old toolchains, you should not be considering its compatibility with them. Alex On Thu, 25 Nov 2021 at

[PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-11-21 Thread Alexander Kanavin via Elfutils-devel
From: Alexander Kanavin Use intmax_t to print time_t time_t is platform dependent and some of architectures e.g. x32, riscv32, arc use 64bit time_t even while they are 32bit architectures, therefore directly using integer printf formats will not work portably, use intmax_t to typecast time_t int

Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-11-20 Thread Alexander Kanavin via Elfutils-devel
On Sat, 20 Nov 2021 at 05:13, Érico Nogueira wrote: > For what it's worth, most of the time64 support patches that I have seen > use "%lld" and `long long` as the type for portable representation of > time, instead of intmax_t, but each should work just as well as the > other. > My original vers

[PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t

2021-11-19 Thread Alexander Kanavin via Elfutils-devel
From: Alexander Kanavin Use intmax_t to print time_t time_t is platform dependent and some of architectures e.g. x32, riscv32, arc use 64bit time_t even while they are 32bit architectures, therefore directly using integer printf formats will not work portably, use intmax_t to typecast time_t int