Subject: time_t and fprintf()
To: None <port-alpha@NetBSD.ORG>
From: Peter Galbavy <peter@wonderland.org>
List: port-alpha
Date: 07/09/1996 16:53:40
On an alpha time_t is defined as an int, and on i386 as a long (I believe
on other platforms too). This causes me a problem when trying to compile
clean code (well, gcc -Wall type clean).
If I want to print a time in seconds, using a time_t variable, then
on the alpha it is a %u whilst on the other platforms a %lu. What
is the "right thing" to do in these circumstances ? (There are a few
hundred of these printf/fprintf calls, and adding casts to each seems
a bit over the top :( )
BTW The man page for ctime(3) say in the first paragraph that the time
in seconds is a long int...
Regards,
--
Peter Galbavy peter@wonderland.org
@ Home phone://44/973/499465
in Wonderland http://www.wonderland.org/~peter/
snail://UK/NW1_6LE/London/21_Harewood_Avenue/