Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jan 2006 21:34:02 +1100
From:      Edwin Groothuis <edwin@mavetju.org>
To:        freebsd-ports@freebsd.org
Subject:   time_t printf()
Message-ID:  <20060108103402.GB3806@k7.mavetju>

next in thread | raw e-mail | index | archive | help
Trying to printf() a time_t value, I tried the following permutations:

    time_t days = 0, hours = 0, minutes = 0, seconds = 0;
    sprintf(buffer, "%2d %2u %2ld %2lu", days, hours, minutes, seconds);

4.11 said:
    misc.c:117: warning: int format, time_t arg (arg 3)
    misc.c:117: warning: unsigned int format, long unsigned int arg (arg 4)

6.0 said:
    misc.c:117: warning: long int format, time_t arg (arg 5)
    misc.c:117: warning: long unsigned int format, time_t arg (arg 6)

So between 4.11 and 6.0 there is no uniform way to printf() time_t
values...

Edwin

-- 
Edwin Groothuis      |            Personal website: http://www.mavetju.org
edwin@mavetju.org    |          Weblog: http://weblog.barnet.com.au/edwin/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060108103402.GB3806>