🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4243

Re: mktime murk

#4243
From: Norman Diamond
Date: Thu, 19 Oct 1995 06:28
18 lines
1688 bytes
In article <45i7bg$op@light.twinsun.com>, eggert@twinsun.com (Paul Eggert) writes:
>There's little dispute about what to do if all the struct tm members
>have in-range values.  If all members are in range, mktime should be
>the inverse of localtime whenever possible (it isn't always possible,
>unfortunately; but we haven't been arguing about _that_ problem).

Sorry to barge in so late, but I think this is the correct answer.
By analogy, there's little dispute about how integer arithmetic is
supposed to behave when all operands and mathematical results have
in-range values.  When a computational exception occurs in integer
arithmetic, behavior is undefined.  When an argument to mktime() is
out of range, you have better luck -- implementation defined.  In
either case, if you want to protect yourself, you write lots of code.
--
 <<  If this were the company's opinion, I would not be allowed to post it.  >>
"I paid money for this car, I pay taxes for vehicle registration and a driver's
license, so I can drive in any lane I want, and no innocent victim gets to call
the cops just 'cause the lane's not goin' the same direction as me" - J Spammer
Technical Details
Message-ID: <464r6c$krt@usenet.pa.dec.com>
Path: arc1-ca.pugleaf.net!jrd.dec.com!diamond
References: <44mio5$63n@mark.ucdavis.edu> <44uosd$1nl@light.twinsun.com> <1995Oct5.054100.3591@sq.com> <452g4g$8o7@light.twinsun.com> <1995Oct11.015651.13458@sq.com> <45i7bg$op@light.twinsun.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!jrd.dec.com!diamond
From: diamond@jrd.dec.com (Norman Diamond)
Newsgroups: comp.std.c
Subject: Re: mktime murk
Date: 19 Oct 1995 06:28:27 GMT
Organization: DEC Japan Research and Development Center
Distribution: world
Message-ID: <464r6c$krt@usenet.pa.dec.com>
References: <44mio5$63n@mark.ucdavis.edu> <44uosd$1nl@light.twinsun.com> <1995Oct5.054100.3591@sq.com> <452g4g$8o7@light.twinsun.com> <1995Oct11.015651.13458@sq.com> <45i7bg$op@light.twinsun.com>
NNTP-Posting-Host: jit533.jrd.dec.com