[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#8890) Bug fix patches unbreaking the build on x32 systems



Hi,

> Thanks. Most of these look OK, but the unconditional use of "long
> long" instead of "long" will break on machines where "long long" is
> not 64 bits.

64 bits is not the requirement for all those, but size of time_t.

Each of these instances was changed from
outputting a time_t with %ld (without cast to long) to
outputting a time_t with %lld after being cast to long long.

As long long is either the same size or greater than long,
this cannot break any existing scenario. It merely fixes the
scenario in which time_t is larger than long but fits into
long long. (It also fixes the case where time_t is smaller
than long, incidentally, as it was not cast, prior.)

Actual bit sizes are of no import here due to the explicit
casts, given that time_t can be of various sizes and, in
constrast to e.g. size_t with its %zu specifier, does not
have a printf specifier of its own.

Fixing this is already common practice for me, as MirBSD/i386
is also a platform with 32-bit long and 64-bit time_t, and
has been for 14 years and about five weeks or so.

bye,
//mirabilos
--  
When he found out that the m68k port was in a pretty bad shape, he did
not, like many before him, shrug and move on; instead, he took it upon
himself to start compiling things, just so he could compile his shell.
How's that for dedication. -- Wouter, about my Debian/m68k revival