Commit Graph

403 Commits

Author SHA1 Message Date
christos
d472a9154a add constcond 2017-01-10 17:44:51 +00:00
wiz
29b4283f3f Fix asctime_r prototype. 2016-12-29 21:03:51 +00:00
abhinav
b2f786d04e As per the IEEE 1003.1-2008 standard, the range of values for the %S
format specifier is [0,60].
2016-12-25 06:37:50 +00:00
abhinav
a4dca42e82 As per C99 the range of values for the %S format specifier is [0,60]
rather than [0,61]. The standard has removed mention of double leap seconds.
The standard has give the following rationale in the time.h man page:

"The range [0,60] seconds allows for positive or negative leap seconds.
The formal definition of UTC does not permit double leap seconds, so all
mention of double leap seconds has been removed, and the range shortened
from the former [0,61] seconds seen in previous versions of POSIX."
2016-12-24 05:33:51 +00:00
abhinav
6672db53ac Remove trailing comma at the end of the last .Nm entry in the NAME section 2016-12-22 17:39:28 +00:00
abhinav
d52ecd3afc Grammar fixes at few places
Also, don't use .D1 inside .Bd (mandoc -Tlint was complaining)
Remove whitespace at the end of a sentence
2016-12-22 17:27:02 +00:00
kre
edb49bae9b Actually, this problem won't be reported upstream, their code is
just ...

	ptrdiff_t nitems_max = PTRDIFF_MAX - WORK_AROUND_QTBUG_53071;
	ptrdiff_t amax = nitems_max < SIZE_MAX ? nitems_max : SIZE_MAX;

which is just fine if you think about it a little,   Unfortunately,
in our zealous effort to never leave a ggc warning unused, and to
treat all of the warnings as fatal errors, that code falls foul of the
"you must not compare an unsigned value with a signed value" warning.

nitems_max is a (signed) largish positive integer (obviously, by
inspection).  If it is less than SIZE_MAX then amax is just nitems_max.
In the unlikely case that size_t has less bits than ptrdiff_t so
SIZE_MAX is smaller, amax is limited to SIZE_MAX (which in that case
is known to fit in the ptrdiff_t and to remain positive).

To pacify gcc (and the way the build system uses it), casts are
required.   Unfortunately the cast that was installed here was to
convert SIZE_MAX to a ptrdiff_t.  Unfortunately when ptrdiff_t has
the same number of bits (or less) as size_t (ie: the common case)
but is signed, (ptrdiff_t)SIZE_MAX is just a fancy way of writing -1.

Rearrange the casting in a way that keeps the original intent
of the code for us (it is actyaly now incorrect if size_t has less
bits than a ptrdiff_t) and keeps gcc happy, all at the same time.

What a mess.
2016-11-05 23:09:37 +00:00
kre
752944af9d Revert a couple of lines of code from tzcode2016i to their state in 2016h
SIZE_MAX is the max value of a size_t (and is unsigned) so when converted
to a ptrdiff_t  (int) becomes -1.   That's not what the code was attempting
to achieve.

This will be reported upstream to the tzcode maintainers, and we'll see
what variation appears in tzcode2016j ...

Until then, the older code always worked for us, so it will do for now.

This should fix the broken i386 build.
2016-11-05 22:21:48 +00:00
christos
375cff8702 lint knows about _Generic 2016-11-05 01:08:58 +00:00
christos
aafaa3c48f tzcode2016i 2016-11-04 19:41:53 +00:00
christos
af580f3ad2 welcome to 2016h 2016-10-20 17:41:34 +00:00
kre
3a37e001c7 Patch 0001 from upstream to tzcode2016g to restore full functionality
of zic -l
2016-10-07 19:47:16 +00:00
christos
9551d334d2 merge tzcode2016g 2016-10-07 15:29:42 +00:00
pgoyette
9a9ece3b27 Since the argument buf is earlier described as a buffer, replace all
references to "the array" with "the buffer" for consistency.

Bump date.
2016-09-22 23:18:10 +00:00
christos
a4f5c51335 use a define, and cast. 2016-09-20 15:03:07 +00:00
christos
42bfe206ef put back part of the code that determines the smallest of INT_MAX and
SIZE_MAX to avoid llvm truncation warning.
2016-09-20 13:09:08 +00:00
christos
5698ccad84 PR/51484: gson@: Fix off by one (wrong merge) 2016-09-19 18:43:23 +00:00
christos
16bd23da7a welcome to tzcond-2016f 2016-09-16 17:12:06 +00:00
dholland
7dae429fbd PR 51003 David Binderman: bzero struct before passing it around.
This is actually unnecessary as the call in question uses only fields
that have been set explicitly, but good practice regardless and it's
not like it's on a performance-critical path.
2016-05-31 03:47:49 +00:00
christos
91e51ad49a remove stray debugging. 2016-05-15 20:37:48 +00:00
christos
6a4222698f Bail out if the string does not look like a timezone (is empty or does not
start with a letter or a number). tzparse("") or tzparse(".45") don't fail.
2016-05-15 20:36:42 +00:00
ginsbach
bec9db1ba3 Use the correct upper bounds for the types array. The correct upper
bound is typecnt not timecnt.  Now perpetual 'standard' time zones
will work correctly as they have a typecnt of 1 but a timecnt of 0.
2016-03-18 12:41:25 +00:00
christos
e4c8546a4c Sync with 2016b 2016-03-15 15:16:01 +00:00
christos
ebc28b6bda PR/50133: Martin Husemann: Can't cache $TZ.
XXX: Pullup-7
2016-02-20 20:11:37 +00:00
ginsbach
3219a72f94 Don't attempt to set TM_ZONE (name) for 'J' as isdst isn't known. 2015-10-31 03:42:00 +00:00
christos
3c0ef4294c make %Z and %z understand the same strings. 2015-10-31 02:14:08 +00:00
ginsbach
b8b1230d48 - Add reference to RFC-3339
- Add J to military / nautical time zone description
2015-10-31 02:09:06 +00:00
ginsbach
fb679626c8 Add 'J' (Juliett) as military time zone name meaning the local time zone. 2015-10-30 21:36:25 +00:00
christos
eff9b12acf drop stray #endif 2015-10-30 18:20:16 +00:00
christos
5ba7c63c3a revert timezone() ifdef; it is wrong (pointed out by ginsbach) 2015-10-30 18:04:42 +00:00
ginsbach
862d86e79e ISO 8601 and RFC 3339 specify that an offset can be up to 23:59 and
not 12:00 east/west.  Just proves that one shouldn't use other
implementations as a canonical reference.  Thanks to all who pointed
this out.
2015-10-30 03:18:10 +00:00
ginsbach
a5eaa096be Reject timezone offsets more than 12 hours (east or west). 2015-10-30 01:49:36 +00:00
wiz
4bdb969ddc Whitespace. 2015-10-29 22:42:55 +00:00
christos
fb1c722214 another lint warning for compat. 2015-10-29 19:18:32 +00:00
christos
5eac10702e - use #defined constants (from gisbach)
- back to setting tm_zone to NULL when we don't know.
2015-10-29 19:18:19 +00:00
christos
4ba084a19e PR/50380: Balazs Scheidler: strptime() returns incorrect values in tm_gmtoff
- Always offset in seconds.
- Handle arbitrary timezones.
2015-10-29 17:54:49 +00:00
christos
37de2f9dd3 Add tzgetgmtoff(3) 2015-10-29 17:53:04 +00:00
christos
cefa99b2ad Document tzgetgmtoff(3) 2015-10-29 17:51:58 +00:00
christos
1aed602970 Add tzgetgmtoff, delint compat 2015-10-29 17:49:24 +00:00
christos
f9589d4feb Release 2015g - 2015-10-01 00:39:51 -0700
Changes affecting code

    localtime no longer mishandles America/Anchorage after 2037.
    (Thanks to Bradley White for reporting the bug.)

    The localtime module allows the variables 'timezone', 'daylight',
    and 'altzone' to be in common storage shared with other modules,
    and declares them in case the system <time.h> does not.
    (Problems reported by Kees Dekker.)

    On platforms with tm_zone, strftime.c now assumes it is not NULL.
    This simplifies the code and is consistent with zdump.c.
    (Problem reported by Christos Zoulas.)

  Changes affecting documentation

   The tzfile man page now documents that transition times denote the
   starts (not the ends) of the corresponding time periods.
   (Ambiguity reported by Bill Seymour.)
2015-10-09 17:21:45 +00:00
riz
f2164b60c8 Remove second 'const' declaration, to hopefully fix clang builds. 2015-08-18 16:54:27 +00:00
christos
d856f74aad merge 2015f 2015-08-13 11:21:18 +00:00
ginsbach
b6db50f38d Only apply am/pm adjustment to tm_hour when it has actually been parsed. 2015-07-29 20:32:54 +00:00
ginsbach
8b0d942b48 More KNF style changes -- consistent use of whitespace in #defines. 2015-07-22 13:33:59 +00:00
ginsbach
2cacd9205d KNF and additional comments 2015-07-20 14:37:11 +00:00
ginsbach
f7bfe448b0 Don't set state when parsing any timezone (%z) information. The '+' in
this case isn't the same as the FreeBSD '%+' str[fp]time() (GNU) extension.
2015-07-15 13:54:38 +00:00
ginsbach
d2fb39874a Set S_WDAY state for %u (same as it is set for %w). 2015-07-14 18:07:17 +00:00
ginsbach
ad43142fb9 Switch to using isleap() and isleap_sum() macros from <tzfile.h> to be
consistent with strftime.c and localtime.c.
2015-07-13 17:45:16 +00:00
christos
68ac8e89d0 remove local copy of tzfile.h 2015-07-11 16:41:08 +00:00
christos
b999beb0fa - don't copy the man pages anymore. they have been converted to mdoc
format.
- don't delete extra files, but mention the 'import' process
2015-07-11 16:09:15 +00:00