scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 317c2fdd2a4f7a4818936ca2afb0626d4c580f75
parent 59a8cce85e45329b3f0eece6b734686313bfb81a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Thu, 16 Apr 2026 11:35:38 +0200

libc/time: Reduce _MAXYEAR in 32 bit systems

We use a simplified overflow check, and we just check for
the maximum year where we can fully encode any date, and
while UNIX time can encode until 2038 with 32 bits it can
encode only until January 19th so if we want to maintain
the simple check that we have then we have to decrease the
maximum year to 2037.

Diffstat:
Minclude/scc/bits/linux/arm/arch/time.h | 2+-
Minclude/scc/bits/linux/i386/arch/time.h | 2+-
Minclude/scc/bits/linux/ppc/arch/time.h | 2+-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/scc/bits/linux/arm/arch/time.h b/include/scc/bits/linux/arm/arch/time.h @@ -1,4 +1,4 @@ -#define _MAXYEAR 2038 +#define _MAXYEAR 2037 #define _MINYEAR 1902 typedef long time_t; diff --git a/include/scc/bits/linux/i386/arch/time.h b/include/scc/bits/linux/i386/arch/time.h @@ -1,4 +1,4 @@ -#define _MAXYEAR 2038 +#define _MAXYEAR 2037 #define _MINYEAR 1902 typedef long time_t; diff --git a/include/scc/bits/linux/ppc/arch/time.h b/include/scc/bits/linux/ppc/arch/time.h @@ -1,4 +1,4 @@ -#define _MAXYEAR 2038 +#define _MAXYEAR 2037 #define _MINYEAR 1902 typedef long time_t;