[Buildroot] [PATCH 1/1] package/nfs-utils: Backport yet another printf fix

Thomas Petazzoni thomas.petazzoni at bootlin.com
Mon Aug 2 20:13:41 UTC 2021


On Mon, 2 Aug 2021 21:17:12 +0200
Petr Vorel <petr.vorel at gmail.com> wrote:

> > And thank you for fixing this :-)  
> Yw. I see time_t printf format is more tricky than I expected, your traditional
> approach with casting to long long would not require this change to uint64_t :).

Actually, we have this printf() / time_t issue on other packages, on
32-bit architectures where time_t is a 64-bit value (RISC-V 32-bit for
example). What is the correct solution in the end?

Apparently, the really standard solution is simply to *not* print a
time_t, as it's supposed to be an opaque type, which can be different
things depending on the underlying implementation. But in practice, a
lot of packages do printf() time_t values.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the buildroot mailing list