From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from deimos.uberspace.de (deimos.uberspace.de [185.26.156.152]) by sourceware.org (Postfix) with ESMTPS id DC94E3858D28 for ; Tue, 15 Mar 2022 15:47:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC94E3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=jdoubleu.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jdoubleu.de Received: (qmail 12143 invoked by uid 989); 15 Mar 2022 15:47:58 -0000 Authentication-Results: deimos.uberspace.de; auth=pass (plain) Content-Type: multipart/mixed; boundary="------------0ki813BUOCR6Oa0n7q1kswna" Message-ID: Date: Tue, 15 Mar 2022 16:47:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Content-Language: de-DE To: newlib@sourceware.org References: <9b1bb39e-0a9c-612e-3aa5-1be15577fb2b@blue-andi.de> From: Joshua Westerheide Subject: Re: Timezones in <+-nn> format are not handled In-Reply-To: <9b1bb39e-0a9c-612e-3aa5-1be15577fb2b@blue-andi.de> X-Rspamd-Bar: --- X-Rspamd-Report: BAYES_HAM(-3) MIME_GOOD(-0.1) X-Rspamd-Score: -3.1 Received: from unknown (HELO unkown) (::1) by deimos.uberspace.de (Haraka/2.8.28) with ESMTPSA; Tue, 15 Mar 2022 16:47:58 +0100 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2022 15:48:05 -0000 This is a multi-part message in MIME format. --------------0ki813BUOCR6Oa0n7q1kswna Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Andi, I've reported the exact same issue a few weeks ago. The maintainers are already working on it and a patch has been posted to the mailing list. A few changes have been requested and it still needs testing. I'll attach the patch and previous discussion. Greetings jdoubleu On 3/15/2022 3:23 PM, Andreas Merkle wrote: > Posix timezone strings are in the format ABRVnn[ABRV[nn]][,...], e.g. > GMT0BST,... is London TZ descriptor with two abbreviations GMT and BST. > ABRV means abbreviation. Such abbreviations are not defined for every > timezone around the world. > According to https://data.iana.org/time-zones/theory.html if there is no > common English abbreviations, use offsets like -05 and +0530 that are > generated by zic's %z notation. > These numeric offsets are enclosed between <...>. For example, > abbreviation for Sao Paulo TZ is <-03>3 (instead of e.g. valid SAOPAUL03). > > A pull request for the newlib-xtensa version by earlephilhower fixes > this: https://github.com/earlephilhower/newlib-xtensa/pull/14 > I would like to provide the corresponding patch here if its ok? > > Andi > --------------0ki813BUOCR6Oa0n7q1kswna Content-Type: message/rfc822; name="[PATCH 2/2] newlib/libc/time/tzset_r.c(_tzset_unlocked_r): POSIX angle bracket <> support.eml" Content-Disposition: attachment; filename*0="[PATCH 2/2] newlib/libc/time/tzset_r.c(_tzset_unlocked_r): P"; filename*1="OSIX angle bracket <> support.eml" Content-Transfer-Encoding: 7bit Return-Path: Delivered-To: jdoubleu-hi@jdoubleu.de Received: (qmail 31958 invoked by uid 989); 25 Feb 2022 16:40:49 -0000 Received: from sourceware.org (server2.sourceware.org [2620:52:3:1::246e:9693:128c]) by deimos.uberspace.de (Haraka/2.8.28) with ESMTPS id E86A12BD-3B2F-4934-AD4B-EFA50B9FBDFE.1 envelope-from tls TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256; Fri, 25 Feb 2022 17:40:44 +0100 Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0793F3857C42 for ; Fri, 25 Feb 2022 16:40:38 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id 308733858C39 for ; Fri, 25 Feb 2022 16:40:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 308733858C39 Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTP id NZkZnbI7SgTZYNddUnvWvn; Fri, 25 Feb 2022 16:40:04 +0000 Received: from BWINGLISD.shawcable.net. ([184.64.124.72]) by cmsmtp with ESMTP id NddTnjEC9qyysNddUnJ0Kj; Fri, 25 Feb 2022 16:40:04 +0000 X-Authority-Analysis: v=2.4 cv=Y6brDzSN c=1 sm=1 tr=0 ts=62190664 a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17 a=r77TgQKjGQsHNAKrUKIA:9 a=jf9T2ZxHsRBIPqn3sicA:9 a=QEXdDO2ut3YA:10 a=gALCQhoubqWXC8tSL1EA:9 a=B2y7HmGcmWMA:10 From: Brian Inglis To: newlib@sourceware.org Subject: [PATCH 2/2] newlib/libc/time/tzset_r.c(_tzset_unlocked_r): POSIX angle bracket <> support Date: Fri, 25 Feb 2022 09:39:59 -0700 Message-Id: <20220225163959.48753-3-Brian.Inglis@SystematicSW.ab.ca> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220225163959.48753-1-Brian.Inglis@SystematicSW.ab.ca> References: <20220225163959.48753-1-Brian.Inglis@SystematicSW.ab.ca> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.35.1" Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfP3RV91cJh7lM6onPS9ARtETIcAC1710y5flroA4/69zywGLiC0AbrMnX23f5vbLTQQmPac1vzO3Pp5YMiq1BGX/xeQy/UtjOtb9gql4GTdsr+HVONSk qH+IhqBGANaB7mm0ym7lEwh7l6D5BFg/TBD7DhafD83Tdeupb6Lo524+NljuXPZkreC/IGLByX5VTZH+98dENMJKu2fBqOehjWT5/F/ZFANYBgvMrPB6Pi2c v4KhNR3JXaH30ffo7CLIBRJsYoMRq7cgndUxFgF84Io= X-Spam-Status: No, score=-1159.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNWANTED_LANGUAGE_BODY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: newlib@sourceware.org Errors-To: newlib-bounces+hi=jdoubleu.de@sourceware.org Sender: "Newlib" Original-Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSW.ab.ca Original-Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca X-Rspamd-Bar: / X-Rspamd-Report: BAYES_HAM(-0.161569) R_SPF_ALLOW(-0.2) MIME_GOOD(-0.1) HAS_LIST_UNSUB(-0.01) MID_CONTAINS_FROM(1) MAILLIST(-0.2) X-Rspamd-Score: 0.32843 This is a multi-part message in MIME format. --------------2.35.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit define POSIX specified minimum TZ abbr size 3 TZNAME_MIN use limits.h TZNAME_MAX, _POSIX_TZNAME_MAX, unistd.h sysconf(_SC_TZNAME_MAX) issue error if no symbols defined (document fallback value in case required) allow POSIX angle bracket < > quoted signed alphanumeric tz abbr e.g. allow POSIX unquoted alphabetic tz abbr e.g. MESZ apply same changes for DST tz abbr --- newlib/libc/time/tzset_r.c | 74 ++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 10 deletions(-) --------------2.35.1 Content-Type: text/x-patch; name="0002-newlib-libc-time-tzset_r.c-_tzset_unlocked_r-POSIX-a.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0002-newlib-libc-time-tzset_r.c-_tzset_unlocked_r-POSIX-a.patch" diff --git a/newlib/libc/time/tzset_r.c b/newlib/libc/time/tzset_r.c index 9e0cf834bd6b..6a5fd578c0be 100644 --- a/newlib/libc/time/tzset_r.c +++ b/newlib/libc/time/tzset_r.c @@ -1,14 +1,30 @@ #include <_ansi.h> +#include /* {,_POSIX_}TZNAME_MAX */ #include #include #include #include +#include /* sysconf(_SC_TZNAME_MAX) */ #include #include #include "local.h" #define sscanf siscanf /* avoid to pull in FP functions. */ +#define TZNAME_MIN 3 /* POSIX specified minimum TZ abbr size */ +/* TZNAME_MAX - POSIX specified maximum TZ abbr size */ +/* define TZNAME_MAX if undefined and available */ +#if !defined(TZNAME_MAX) +#if defined(_POSIX_TZNAME_MAX) +#define TZNAME_MAX _POSIX_TZNAME_MAX /* use POSIX value */ +#elif defined(_SC_TZNAME_MAX) +#define TZNAME_MAX sysconf(_SC_TZNAME_MAX) /* use sysconf value */ +#else +#error "None of TZNAME_MAX, _POSIX_TZNAME_MAX, _SC_TZNAME_MAX are defined" +#define TZNAME_MAX 9 /* could use fallback value */ +#endif /* defined _POSIX_TZNAME_MAX || _SC_TZNAME_MAX */ +#endif /* !defined(TZNAME_MAX) */ + static char __tzname_std[11]; static char __tzname_dst[11]; static char *prev_tzenv = NULL; @@ -45,8 +61,25 @@ _tzset_unlocked_r (struct _reent *reent_ptr) if (*tzenv == ':') ++tzenv; - if (sscanf (tzenv, "%10[^0-9,+-]%n", __tzname_std, &n) <= 0) - return; + /* allow POSIX angle bracket < > quoted signed alphanumeric tz abbr e.g. */ + if (*tzenv == '<') + { + ++tzenv; + + /* quit if no items, too few or too many chars, or no close quote '>' */ + if (sscanf (tzenv, "%10[-+0-9A-Za-z]%n", __tzname_std, &n) <= 0 + || n < TZNAME_MIN || TZNAME_MAX < n || '>' != tzenv[n]) + return; + + ++tzenv; /* bump for close quote '>' */ + } + else + { + /* allow POSIX unquoted alphabetic tz abbr e.g. MESZ */ + if (sscanf (tzenv, "%10[A-Za-z]%n", __tzname_std, &n) <= 0 + || n < TZNAME_MIN || TZNAME_MAX < n) + return; + } tzenv += n; @@ -68,17 +101,38 @@ _tzset_unlocked_r (struct _reent *reent_ptr) tz->__tzrule[0].offset = sign * (ss + SECSPERMIN * mm + SECSPERHOUR * hh); _tzname[0] = __tzname_std; tzenv += n; - - if (sscanf (tzenv, "%10[^0-9,+-]%n", __tzname_dst, &n) <= 0) - { /* No dst */ - _tzname[1] = _tzname[0]; - _timezone = tz->__tzrule[0].offset; - _daylight = 0; - return; + + /* allow POSIX angle bracket < > quoted signed alphanumeric tz abbr e.g. */ + if (*tzenv == '<') + { + ++tzenv; + + /* quit if no items, too few or too many chars, or no close quote '>' */ + if (sscanf (tzenv, "%10[-+0-9A-Za-z]%n", __tzname_dst, &n) <= 0 + || n < TZNAME_MIN || TZNAME_MAX < n || '>' != tzenv[n]) + { /* No dst */ + _tzname[1] = _tzname[0]; + _timezone = tz->__tzrule[0].offset; + _daylight = 0; + return; + } + + ++tzenv; /* bump for close quote '>' */ } else - _tzname[1] = __tzname_dst; + { + /* allow POSIX unquoted alphabetic tz abbr e.g. MESZ */ + if (sscanf (tzenv, "%10[A-Za-z]%n", __tzname_dst, &n) <= 0 + || n < TZNAME_MIN || TZNAME_MAX < n) + { /* No dst */ + _tzname[1] = _tzname[0]; + _timezone = tz->__tzrule[0].offset; + _daylight = 0; + return; + } + } + _tzname[1] = __tzname_dst; tzenv += n; /* otherwise we have a dst name, look for the offset */ --------------2.35.1-- --------------0ki813BUOCR6Oa0n7q1kswna Content-Type: message/rfc822; name="Support non-POSIX TZ strings.eml" Content-Disposition: attachment; filename="Support non-POSIX TZ strings.eml" Content-Transfer-Encoding: 8bit Return-Path: Delivered-To: jdoubleu-hi@jdoubleu.de Received: (qmail 1905 invoked by uid 989); 14 Feb 2022 17:10:51 -0000 Received: from sourceware.org (server2.sourceware.org [2620:52:3:1::246e:9693:128c]) by deimos.uberspace.de (Haraka/2.8.28) with ESMTPS id 48AF94A2-6EB9-4807-95D0-C1CC24DC4BBA.1 envelope-from tls TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256; Mon, 14 Feb 2022 18:10:45 +0100 Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B54FA385803D for ; Mon, 14 Feb 2022 17:10:39 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) by sourceware.org (Postfix) with ESMTPS id 2A0DA3858C27 for ; Mon, 14 Feb 2022 17:10:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A0DA3858C27 Received: from shw-obgw-4001a.ext.cloudfilter.net ([10.228.9.142]) by cmsmtp with ESMTP id JecbnK9xyyr5HJernnLgU7; Mon, 14 Feb 2022 17:10:23 +0000 Received: from [10.0.0.5] ([184.64.124.72]) by cmsmtp with ESMTP id JernnlE85ebQ7Jernn93qN; Mon, 14 Feb 2022 17:10:23 +0000 X-Authority-Analysis: v=2.4 cv=fZK+dmcF c=1 sm=1 tr=0 ts=620a8cff a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17 a=IkcTkHD0fZMA:10 a=CCpqsmhAAAAA:8 a=mDV3o1hIAAAA:8 a=GcyzOjIWAAAA:8 a=I0CVDw5ZAAAA:8 a=N6dHsvTjAAAA:20 a=NEAV23lmAAAA:8 a=uZvujYp8AAAA:8 a=te1EGT4yAAAA:8 a=ejknC5xS72zp2OFXFO8A:9 a=QEXdDO2ut3YA:10 a=Gy5p1UE1U9UA:10 a=x8iypR0hzvIA:10 a=7KOiVEw-WwsA:10 a=AomDDAB-fV4A:10 a=tpO3km1f0-YA:10 a=LZNa0TB5dTIA:10 a=ul9cdbp4aOFLsgKbc677:22 a=_FVE-zBwftR9WsbkzFJk:22 a=hQL3dl6oAZ8NdCsdz28n:22 a=YdXdGVBxRxTCRzIkH2Jn:22 a=SLzB8X_8jTLwj6mN0q5r:22 a=RRElR4r2U1jGY2dU47NL:22 Message-ID: <758cfb47-ac13-fb88-877e-63a1d4327429@SystematicSw.ab.ca> Date: Mon, 14 Feb 2022 10:10:23 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Support non-POSIX TZ strings Content-Language: en-CA To: newlib@sourceware.org References: From: Brian Inglis Organization: Systematic Software In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4xfAi4y8cRJzZosYMltJLyv1e9oAwuINPsuMtBFtLFGpWxfgPHPjkNZP9imVn6bUG7ezsWcnkLV9LJFg4gP4g3rUpLCPXLArBvCzArn1azpM1ApxD0W4Df FlSNeh7pFOTY54hdQNF8AOcfDZs3r9LLg3SJ6jk/PtU09d6C0RjftVPvldbPNNOMwJE+NCFiRnnQjl0cCML4tbzdTL7mspDvUIA= X-Spam-Status: No, score=-1163.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: newlib@sourceware.org Errors-To: newlib-bounces+hi=jdoubleu.de@sourceware.org Sender: "Newlib" Original-Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Original-Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca X-Rspamd-Bar: / X-Rspamd-Report: R_SPF_ALLOW(-0.2) BAYES_HAM(-0.007124) MIME_GOOD(-0.1) HAS_LIST_UNSUB(-0.01) MAILLIST(-0.2) X-Rspamd-Score: -0.517124 On 2022-02-14 06:21, jdoubleu wrote: > Hello, > > I stumbled upon an issue with some TZ strings not handled as expected by newlib's tzset() function. > The tzset functions expects the string stored in the TZ environment variable to follow the POSIX format as described here: https://sourceware.org/newlib/libc.html#tzset (or https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html ). > > However, the glibc implementation extends the format and additionally allows ‘<[+|-]hh[:mm[:ss]]>’ in the format (compare https://www.man7.org/linux/man-pages/man3/tzset.3.html ). It seems like the timezone database (zoneinfo) provided by the IANA (https://www.iana.org/time-zones ) adopted that format; or at least the zic compiler generates these strings in the zoneinfo files for most systems. > > That leads to the timezone for "America/Argentina/Buenos_Aires” to be "<-03>3”, as can be seen in this dump https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv or a linux system: `tail -n 1 /usr/share/zoneinfo/America/Argentina/Buenos_Aires`. > > Some more background information can be found here https://github.com/esp8266/Arduino/issues/8423 and here https://github.com/esp8266/Arduino/issues/7690 . > > One way to approach this is for the user to just replace the incompatible part of the string with a valid timezone identifier, as proposed by https://github.com/esp8266/Arduino/pull/7699 . > Since the timezone identifier (e.g. `PST`, `PDT`, `CET`, …) is not really used elsewhere by newlib, this should not be a problem, as far as I can imagine. > > On the other hand, some ports implemented a proper parsing: https://github.com/earlephilhower/newlib-xtensa/pull/14 . > > Now my question is whether the extended format should be support by newlib? Is this desired behaviour and would you accept code contributions for that matter? Not sure what point you are trying to make and your terminology is non-standard, but we should start with the actual POSIX spec under TZ: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03 and the current implementation: https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/time/tzset_r.c which does not handle "<" ">" quoted POSIX +/-numeric time zone *abbreviations*, now common in the TZ database. The BSD or TZcode implementations could probably be adapted to update newlib tzset to avoid reinvention e.g. https://github.com/eggert/tz/blob/main/newtzset.3 https://github.com/eggert/tz/blob/main/localtime.c#L1081 thru https://github.com/eggert/tz/blob/main/localtime.c#L1400 [The original (American) English language time zone abbreviations were often made up by the (American) TZ database maintainers and mailing list users, and never used or published in the locale (e.g Germany used German language time zone abbreviations like MEZ/MESZ not MET, similarly for other European countries, see CLDR time zone abbreviations), only by (American) English and mailing list users. These made up (American) English language time zone abbreviations were tracked down and replaced by the current TZ database maintainers after the POSIX spec was expanded, but none are considered canonical, and CLDR locale time zone abbreviations, as supported by ICU, are preferred (see announcements on the home page https://unicode.org/). ICU4X (https://github.com/unicode-org/icu4x) is being developed to support "resource constrained" environments, but as the language bindings include Rust, Objective C, C++, whether that will be usable with embedded libraries such as newlib, musl, uclibc, dietlibc, picolibc, might be ascertained by starting a discussion as encouraged on the project site.] -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] --------------0ki813BUOCR6Oa0n7q1kswna Content-Type: message/rfc822; name="Support non-POSIX TZ strings.eml" Content-Disposition: attachment; filename="Support non-POSIX TZ strings.eml" Content-Transfer-Encoding: 7bit Return-Path: Delivered-To: jdoubleu-hi@jdoubleu.de Received: (qmail 31141 invoked by uid 989); 15 Feb 2022 22:03:09 -0000 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) by deimos.uberspace.de (Haraka/2.8.28) with ESMTPS id 345C36FD-8A7A-4E5D-A9A8-81037E6F46DE.1 envelope-from tls TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256; Tue, 15 Feb 2022 23:03:04 +0100 Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 29D39385800B for ; Tue, 15 Feb 2022 22:02:58 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) by sourceware.org (Postfix) with ESMTPS id C53123858C83 for ; Tue, 15 Feb 2022 22:02:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C53123858C83 Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id K1T6n4Jmk5Rf1K5uDn7MGt; Tue, 15 Feb 2022 22:02:41 +0000 Received: from [10.0.0.5] ([184.64.124.72]) by cmsmtp with ESMTP id K5uCnBZzM3exBK5uDn3sE3; Tue, 15 Feb 2022 22:02:41 +0000 X-Authority-Analysis: v=2.4 cv=d7HmdDvE c=1 sm=1 tr=0 ts=620c2301 a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17 a=IkcTkHD0fZMA:10 a=7vT8eNxyAAAA:8 a=CCpqsmhAAAAA:8 a=NEAV23lmAAAA:8 a=uYT-Tk0qkVT609LjNaIA:9 a=QEXdDO2ut3YA:10 a=Mzmg39azMnTNyelF985k:22 a=ul9cdbp4aOFLsgKbc677:22 Message-ID: Date: Tue, 15 Feb 2022 15:02:40 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: Support non-POSIX TZ strings Content-Language: en-CA To: newlib@sourceware.org References: <758cfb47-ac13-fb88-877e-63a1d4327429@SystematicSw.ab.ca> From: Brian Inglis Organization: Systematic Software In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4xfGazuRTOJU0FIGW6mLYAoM8cq/zWd5v41jGlbK/QFSGYAVL5FE647gewmYuBkSTXhJ8aUSjLP/5bcdGkbK2qt/BANp1LJK+vARfznl5mIGwhyt41nAHR E5bNCJozJ+X7YI8awFopwCMYJRVqGt8fl1ieUP/FmJz3zB+HIsYrEbNvaCqLEvElcgTNYCeqtJto4B1b8ZhZs/rsSaOfBHFlTuI= X-Spam-Status: No, score=-1163.8 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: newlib@sourceware.org Errors-To: newlib-bounces+hi=jdoubleu.de@sourceware.org Sender: "Newlib" Original-Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Original-Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca X-Rspamd-Bar: --- X-Rspamd-Report: R_SPF_ALLOW(-0.2) BAYES_HAM(-2.583411) MIME_GOOD(-0.1) HAS_LIST_UNSUB(-0.01) MAILLIST(-0.2) X-Rspamd-Score: -3.093411 On 2022-02-14 14:33, Jeff Johnston wrote: > On Mon, Feb 14, 2022 at 3:46 PM Brian Inglis < > Brian.Inglis@systematicsw.ab.ca> wrote: > >> On 2022-02-14 12:58, jdoubleu wrote: >>> On 22-02-14 10:10-0700, Brian Inglis wrote: >> >>>> [..] but we should start with the actual POSIX spec under TZ >> >>> Yes, that is exactly what I meant: Newlib supporting the <> (angle >>> brackets) syntax. >>> I didn't know that it was actually part of POSIX spec, since so many >>> libs actually don't implement it. >> >> Most should have by now if maintained: we should be a laggard! ;^> >> >>>> The BSD or TZcode implementations could probably be adapted [..] >> >>> It looks like the TZcode implementation by Paul Eggert uses a different >>> approach to parsing the strings, than the current implementation in >>> newlib >>> ( >> https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/time/tzset_r.c). >> >>> I'm not sure, if you want to copy the code over or use changes by e.g. >>> Earle F. Philhower from >>> https://github.com/earlephilhower/newlib-xtensa/pull/14. >>> Because of the above question, I'm not sure how to continue on this. I >>> would like to contribute myself and submit an implementation, but I'll >>> wait for feedback by other maintainers, first. >> >> Upstream sources like BSDs or TZcode official reference implementations >> are normally preferred because they are feature complete, regularly >> maintained, feature test and standards compliant, vulnerabilities >> checked, issues reported, and promptly fixed. >> >> I checked the BSDs and they seem to have adopted or adapted the TZcode >> official reference implementation, so I am not sure from where it may >> have been adopted, or whether it is original: the maintainer Jeff >> Johnson may remember. > Unfortunately, I do not remember the exact details from back then. With no > license header, it means it was written by Cygnus/Red Hat. >> I also wonder if the GMT defaults should be updated to UTC. Submitted a newlib patch which builds okay, but cannot test, as I don't have a newlib platform to run on, and Cygwin uses it's own TZ DB code base. It should accept up to 10 character abbreviations for STD and DST matching POSIX specs including anything within < > quoted content. If someone needing this could build, test, and send feedback, I'd appreciate it. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] --------------0ki813BUOCR6Oa0n7q1kswna--