This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Minor doc updates.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]