This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Minor doc updates.
- From: Phil Edwards <phil at jaj dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Geoffrey Keating <geoffk at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 1 Aug 2002 13:28:55 -0400
- Subject: Re: Minor doc updates.
- References: <200207292348.g6TNmjW02378@pride.sfbay.redhat.com> <20020730155056.GB22501@codesourcery.com>
On Tue, Jul 30, 2002 at 08:50:56AM -0700, Zack Weinberg wrote:
> Hmm...
>
> time_t tt = time (NULL);
> struct tm *tb = localtime (&tt);
>
> We ought to be checking the return values here. It is vanishingly
> unlikely that time() will fail, but localtime() might not be able to
> find its timezone database, and then we'll try to dereference a null
> pointer.
>
> "??:??:??" and "??? ?? ????" seem like reasonable failure-mode strings
> to return. Anyone have a better idea?
Those seem quite reasonable, as long as they're put into a FAQ or a manual.
(Something that can be found in an online search, at least.)
Phil
--
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams