On Thu, Feb 13, 2020 at 05:40:29PM +0800, YunQiang Su wrote:
> just redefine time_t to 64bit may also cause a problem:
>    a bad designed and old network protocol which aims  only target 32bit 
> system,
>    a binary data packet, may contain time_t:
>         struct {
>             int a;
>             time_t b;
>         }
> just define time_t to 64 will break this protocol, although it is bad 
> designed.
> 
> Currently, the major task of 32bit ports is to keep compatible with
> old system/binary.
> Should we really want to break them?

Proposal D:
on 32-bit (except x32 which already has 64-bit time_t):
typedef time_t unsigned long;

That'll keep the ABI intact yet will kick the problem 68 years into the
future.  By year 2106, folks will be used to using qemu/equivalent for
running 20th century stuff...

Some programs may still break (if they cast time_t to int or signed long),
but most should either work ok or get only display wrong.

I sometimes still play Master of Orion 2, and seeing saves dated 19120 is
not that bad. :p


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ 
⢿⡄⠘⠷⠚⠋⠀ A white dwarf seeks a red giant for a binary relationship.
⠈⠳⣄⠀⠀⠀⠀

Reply via email to