4d306b3a17
Fix EOVERFLOW-related problems noted by Chistos Zoulas.
...
See: http://mm.icann.org/pipermail/tz/2014-October/021692.html
* asctime.c (asctime_r): Remove now-unnecessary EOVERFLOW ifdef.
* localtime.c (timesub): Set errno to EOVERFLOW on overflow.
POSIX requires this.
(ctime, ctime_r): Return NULL instead of having undefined behavior
when the time stamp is out of struct tm range. NetBSD does this,
the standards allow it, and it's nicer for users.
* private.h (EOVERFLOW): Default to EINVAL on ancient hosts that lack it.
* NEWS: Document this.
2014-10-08 11:03:57 -07:00
5bfa967c17
Avoid (void) before calls.
...
Although the cast to void in usage like '(void) printf ("Hello")'
may have been helpful decades ago when Lint Was Your Friend,
nowadays such casts are not helpful. The tz code is currently not
consistent about this: sometimes the casts are present, and
sometimes absent. As they make the code harder to read, let's
remove them.
* asctime.c, date.c, ialloc.c, localtime.c, strftime.c, zdump.c, zic.c:
Don't cast calls to 'void'.
2014-08-25 08:19:47 -07:00
8f065f5aa9
* asctime.c, newctime.3, newtzset.3: Don't imply ASCII is required.
2014-06-28 14:09:32 -07:00
2151ca6b20
Restore 'register'.
...
* asctime.c (asctime_r, asctime):
* date.c (main, dogmt, reset, nondigit, sametm, convert, checkfinal):
* ialloc.c (icatalloc):
* localtime.c (detzcode, detzcode64, settzname, tzload)
(typesequiv, getzname, getqzname, getnum, getsecs, getoffset)
(getrule, transtime, tzparse, tzset, localsub, gmtsub)
(leaps_thru_end_of, timesub, increment_overflow)
(long_increment_overflow, normalize_overflow)
(long_normalize_overflow, tmcomp, time2sub, time1, leapcorr):
* scheck.c (scheck):
* strftime.c (_yconv):
* zdump.c (my_localtime, abbrok, main, yeartot, hunt)
(delta, show, abbr, dumptime):
* zic.c (main, dolink, itsdir, associate, infile, inrule)
(inzone, inzcont, inzsub, inleap, inlink, rulesub, convert64)
(writezone, doabbr, stringoffset, stringrule, stringzone)
(outzone, addtype, leapadd, adjleap, ciequal, itsabbr, byword)
(getfields, rpytime, newabbr, mkdirs):
Restore the uses of 'register', reverting that part of the
"More C modernization" patch. See Arthur David Olson in
<http://mm.icann.org/pipermail/tz/2012-October/018385.html >.
2012-10-26 17:37:42 -07:00
c350bfd55f
More C modernization.
...
* Makefile (typecheck): Add -D__time_t_defined to CFLAGS,
for glibc 2.15.
* asctime.c (asctime_r, asctime):
* date.c (main, dogmt, reset, nondigit, sametm, convert, checkfinal):
* ialloc.c (icatalloc):
* localtime.c (detzcode, detzcode64, settzname, tzload)
(typesequiv, getzname, getqzname, getnum, getsecs, getoffset)
(getrule, transtime, tzparse, tzset, localsub, gmtsub)
(leaps_thru_end_of, timesub, increment_overflow)
(long_increment_overflow, normalize_overflow)
(long_normalize_overflow, tmcomp, time2sub, time1, leapcorr):
* scheck.c (scheck):
* strftime.c (_yconv):
* zdump.c (my_localtime, abbrok, main, yeartot, hunt)
(delta, show, abbr, dumptime):
* zic.c (main, dolink, itsdir, associate, infile, inrule)
(inzone, inzcont, inzsub, inleap, inlink, rulesub, convert64)
(writezone, doabbr, stringoffset, stringrule, stringzone)
(outzone, addtype, leapadd, adjleap, ciequal, itsabbr, byword)
(getfields, rpytime, newabbr, mkdirs):
Omit 'register', as it adds no value these days. See Christos Zoulas in
<http://mm.icann.org/pipermail/tz/2012-October/018376.html >.
* date.c (netsettime) [TSP_SETDATE]: Add forward decl.
Don't rely on implicit int. Now static. Use NULL, not 0.
* zdump.c: Include "limits.h".
(absolute_min_time, absolute_max_time): Compute at compile-time,
as the run-time tests relied on undefined behavior.
(checkabsolutes): Rename from setabsolutes. Just check, since
there's nothing to set now. All uses changed.
2012-10-26 00:48:01 -07:00
400ecf36bb
Assume C89.
...
* Makefile (GCC_DEBUG_FLAGS): Modernize for GCC 4.6.3 x86.
* asctime.c (asctime_r, asctime):
* date.c (main, dogmt, reset, wildinput, nondigit, oops, display)
(timeout, sametm, netsettime):
* difftime.c (difftime):
* ialloc.c (icatalloc, icpyalloc):
* localtime.c (detzcode, detzcode64, differ_by_repeat)
(tzload, typesequiv, getzname, getnum, getsecs, getoffset)
(getrule, transtime, tzparse, gmtload, tzsetwall, tzset)
(localsub, localtime, localtime_r, gmtsub, gmtime, gmtime_r)
(offtime, leaps_thru_end_of, timesub, ctime, ctime_r)
(increment_overflow, long_increment_overflow)
(normalize_overflow, long_normalize_overflow, tmcomp, time2sub)
(time2, time1, mktime, timelocal, timegm, timeoff, gtime)
(leapcorr, time2posix, posix2time):
* scheck.c (scheck):
* strftime.c (strftime, _fmt, _conv, _add, _yconv, _loc):
* zdump.c (my_localtime, abbrok, usage, main, yeartot)
(delta, abbr, dumptime):
* zic.c (memcheck, eats, eat, error, warning, main)
(dolink, itsdir, rcomp, associate, infile, gethms, inrule)
(inzone, inzcont, inzsub, inleap, inlink, rulesub, convert)
(convert64, puttzcode, puttzcode64, atcomp, is32, writezone, DO)
(doabbr, updateminmax, stringoffset, stringrule, stringzone)
(outzone, addtt, addtype, leapadd, yearistype, lowerit, ciequal)
(itsabbr, byword, getfields, oadd, tadd, rpytime, newabbr)
(mkdirs, eitol):
Assume C89 or better. Mostly this consists of using function
prototypes. In a few places, prototypes are required for
portability to hosts where time_t does not promote to itself and
where a preceding prototype does not override a definition. But
while we're at it we might as well be consistent: it's safe to
assume at-least-C89 these days.
* ialloc.c (nonzero, imalloc, icalloc, irealloc, ifree, icfree):
Remove; no longer needed now that we assume C89 or better.
All callers changed to use malloc, calloc, realloc, free.
* localtime.c (getzname, getqzname, leaps_thru_end_of, transtime):
* zdump.c (delta, yeartot):
* zic.c (eitol):
Now pure.
* private.h, zdump.c (ATTRIBUTE_PURE): New macro.
* private.h (icalloc, imalloc, irealloc, icfree, ifree): Remove decls.
* zic.c: Remove no-longer-necessary forward decls.
(max_time, min_time): Now const.
(setboundaries): Remove.
2012-10-12 07:53:12 -07:00
dccd5a16af
Switch from SCCS to git.
...
Remove the SCCS keyword '%W%' from all files.
Mostly this just remove comments.
Remove trailing white space, too.
* Makefile (TZCODE_VERSION): New macro.
(version.h): New rule.
(tzselect): Interpolate TZCODE_VERSION.
(clean): Remove version.h.
(zdump.o, zic.o): Depend on version.h.
* asctime.c, date.c, difftime.c, ialloc.c, localtime.c, scheck.c:
* strftime.c, zdump.c, zic.c: Remove elsieid.
* private.h: Remove privatehid.
* tzfile.h: Remove tzfilehid.
* tzselect.h (TZCODE_VERSION): Rename from VERSION.
* zdump.c, zic.c: Include "version.h",
and use TZCODE_VERSION instead of elsieid.
2012-07-18 17:30:38 -07:00
8399649d38
optimization
...
SCCS-file: asctime.c
SCCS-SID: 8.5
2012-07-18 03:03:09 -04:00
3355ce8b30
KRE improvement
...
SCCS-file: asctime.c
SCCS-SID: 8.4
2012-07-18 03:03:09 -04:00
6e327bf9c4
check for NULL asctime argument
...
SCCS-file: asctime.c
SCCS-SID: 8.3
2012-07-18 03:03:09 -04:00
fe7b0ab955
avoid gcc warning on asctime formats
...
SCCS-file: asctime.c
SCCS-SID: 8.2
2012-07-18 03:02:57 -04:00
8327f69d13
electronic mail addresses purged
...
SCCS-file: asctime.c
SCCS-SID: 7.32
2012-07-18 03:02:51 -04:00
a89c854270
delinted
...
SCCS-file: asctime.c
SCCS-SID: 7.31
2012-07-18 03:02:47 -04:00
b2ad2ce175
comment added re not punting to strftime
...
SCCS-file: asctime.c
SCCS-SID: 7.30
2012-07-18 03:02:46 -04:00
3626176d0e
Eggert mod
...
SCCS-file: asctime.c
SCCS-SID: 7.29
2012-07-18 03:02:44 -04:00
90a3ee53fe
SCCS-file: asctime.c
...
SCCS-SID: 7.28
2012-07-18 03:02:44 -04:00
3368436d3f
STRICTLY_STANDARD_ASCTIME work
...
SCCS-file: asctime.c
SCCS-SID: 7.27
2012-07-18 03:02:44 -04:00
cf33d9e264
SCCS-file: asctime.c
...
SCCS-SID: 7.26
2012-07-18 03:02:44 -04:00
e453b47a24
call strftime to get year
...
SCCS-file: asctime.c
SCCS-SID: 7.25
2012-07-18 03:02:44 -04:00
cccdabd8ab
SCCS-file: asctime.c
...
SCCS-SID: 7.23
2012-07-18 03:02:44 -04:00
ff3fc56d0f
hopefully finalized
...
SCCS-file: asctime.c
SCCS-SID: 7.22
2012-07-18 03:02:43 -04:00
23d2f235ca
gratuitous optimization
...
SCCS-file: asctime.c
SCCS-SID: 7.20
2012-07-18 03:02:43 -04:00
5486af3ab8
grammar
...
SCCS-file: asctime.c
SCCS-SID: 7.19
2012-07-18 03:02:43 -04:00
1f18c970d0
gcc note
...
SCCS-file: asctime.c
SCCS-SID: 7.18
2012-07-18 03:02:43 -04:00
8c781fe1fa
SCCS-file: asctime.c
...
SCCS-SID: 7.17
2012-07-18 03:02:43 -04:00
c3aa8c70e0
SCCS-file: asctime.c
...
SCCS-SID: 7.16
2012-07-18 03:02:43 -04:00
f9a007fe6e
SCCS-file: asctime.c
...
SCCS-SID: 7.15
2012-07-18 03:02:43 -04:00
5d2b38f423
partial responses to feedback
...
SCCS-file: asctime.c
SCCS-SID: 7.14
2012-07-18 03:02:43 -04:00
bcd04d67f8
final?
...
SCCS-file: asctime.c
SCCS-SID: 7.13
2012-07-18 03:02:43 -04:00
cf0ac17f5a
hopefully finalized for 2004
...
SCCS-file: asctime.c
SCCS-SID: 7.12
2012-07-18 03:02:43 -04:00
771cc77af1
standard conformance
...
SCCS-file: asctime.c
SCCS-SID: 7.11
2012-07-18 03:02:43 -04:00
ce0e9d774e
a la Eggert
...
SCCS-file: asctime.c
SCCS-SID: 7.10
2012-07-18 03:02:43 -04:00
39d4dda1c4
Guy Harris additions of asctime_r and ctime_r
...
SCCS-file: asctime.c
SCCS-SID: 7.9
2012-07-18 03:02:30 -04:00
2c95e300d0
convert dates
...
SCCS-file: asctime.c
SCCS-SID: 7.8
2012-07-18 03:02:24 -04:00
2f56a7e05f
disclaimers
...
SCCS-file: asctime.c
SCCS-SID: 7.7
2012-07-18 03:02:23 -04:00
0074d8e739
INT_STRLEN_MAXIMUM work
...
SCCS-file: asctime.c
SCCS-SID: 7.5
2012-07-18 03:02:09 -04:00
7cc033b494
bug fix, slight optimizations
...
SCCS-file: asctime.c
SCCS-SID: 7.4
2012-07-18 03:02:09 -04:00
1ccf72f428
result declaration change
...
SCCS-file: asctime.c
SCCS-SID: 7.3
2012-07-18 03:02:09 -04:00
abd026e22b
delinted and bullet-proofed
...
SCCS-file: asctime.c
SCCS-SID: 7.2
2012-07-18 03:02:09 -04:00
0546733d98
headers redone; delinted
...
SCCS-file: asctime.c
SCCS-SID: 4.4
2012-07-18 03:01:57 -04:00
a616419a9a
core dump avoidance
...
SCCS-file: asctime.c
SCCS-SID: 4.3
2012-07-18 03:01:57 -04:00
8d14b52e90
delinted
...
SCCS-file: asctime.c
SCCS-SID: 3.8
2012-07-18 03:01:48 -04:00
0870589968
more standard work
...
SCCS-file: asctime.c
SCCS-SID: 3.7
2012-07-18 03:01:47 -04:00
94ba00dd81
standardization
...
SCCS-file: asctime.c
SCCS-SID: 3.6
2012-07-18 03:01:47 -04:00
9e13c00551
more STDC work
...
SCCS-file: asctime.c
SCCS-SID: 3.5
2012-07-18 03:01:47 -04:00
a623b0fa7d
yet more work
...
SCCS-file: asctime.c
SCCS-SID: 3.4
2012-07-18 03:01:47 -04:00
d0498e791a
ANSI
...
SCCS-file: asctime.c
SCCS-SID: 3.3
2012-07-18 03:01:46 -04:00
32221a21c0
mod sources changes
...
SCCS-file: asctime.c
SCCS-SID: 3.2
2012-07-18 03:01:44 -04:00
160343f7bc
typo fix
...
SCCS-file: asctime.c
SCCS-SID: 1.6
2012-07-18 03:01:42 -04:00
50718cb109
12 -> MONS_PER_YEAR
...
SCCS-file: asctime.c
SCCS-SID: 1.4
2012-07-18 03:01:42 -04:00