Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Jan 2013 21:47:28 -0800
From:      Michael Sierchio <kudzu@tenebras.com>
To:        Garance A Drosehn <gad@freebsd.org>
Cc:        "Thomas D. Dean" <tomdean@speakeasy.org>, "questions@FreeBSD.org" <questions@freebsd.org>
Subject:   Re: time_t definition
Message-ID:  <CAHu1Y72w0i3DB%2BveA92ErCE8ehP6U-MK7txYHgXxixBhYEzYtg@mail.gmail.com>
In-Reply-To: <50FCBEFB.3010102@FreeBSD.org>
References:  <50F5A189.7000701@speakeasy.org> <20130116120015.3b8d0db4@mr129166> <50F6EDFB.70501@speakeasy.org> <50FCBEFB.3010102@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 20, 2013 at 8:07 PM, Garance A Drosehn <gad@freebsd.org> wrote:
> Yes, this means that the only reliable way to printf a time_t is
> to use a cast.  That has been true for at least a decade.  It may
> be true that you happened to avoid this issue before, but the only
> *RELIABLE* platform-independent way to print time_t's is via a cast.

Especially for variadic functions like printf.  You can reasonably
assume that arithmetic expressions will automagically promote a type
to the proper size, but you (Garance) ably reinforce what we've been
trying to convey about this particular example.


Well, Brahma said, even after ten thousand explanations, a fool is no
wiser, but an intelligent man requires only two thousand five hundred.

  - The Mah=C4=81bh=C4=81rata.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHu1Y72w0i3DB%2BveA92ErCE8ehP6U-MK7txYHgXxixBhYEzYtg>