[cfarm-users] What are people testing 32-bit builds on?
Jonathan Wakely
jwakely.gcc at gmail.com
Fri May 15 15:29:19 CEST 2026
On Fri, 15 May 2026 at 12:09, Joel Sherrill via cfarm-users
<cfarm-users at lists.tetaneutral.net> wrote:
>
> On 5/15/2026 2:49 AM, Peter Gutmann via cfarm-users wrote:
> > An additional note for people targeting embedded, a number of RTOS vendors
> > have solved the time_t problem by making it unsigned, so remember to use
> > ( time_t ) casts everywhere you check values, e.g. comparing to -1.
>
> Making it unsigned is wrong per POSIX since at least Issue 6. This page
> has a 2004 copyright so it has been that way a long time.
>
> https://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/types.h.html
Where does it say signed integer type? It says integer type of
floating-point type, but an unsigned integer type is an integer type.
Dates before the epoch are not defined in POSIX, so there's not really
any need to represent negative time_t values (you would need them if
you use time_t for durations rather than time points, but there's a
reason that difftime returns double, not time_t).
Anyway, POSIX has changed, so what it said in 2004 no longer binds
implementations.
In POSIX.1-2001 it was allowed to be a floating-point type, but since
2008 it's not.
The current POSIX standard just says it's an integer type of at least
64 bits. Before that it just said an integer type.
More information about the cfarm-users
mailing list