From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) by sourceware.org (Postfix) with ESMTPS id 20A2A3858D28 for ; Mon, 19 Sep 2022 23:21:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20A2A3858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=systematicsw.ab.ca Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id aGu5olcFjS8WraQ52oaXOR; Mon, 19 Sep 2022 23:21:36 +0000 Received: from [10.0.0.5] ([184.64.124.72]) by cmsmtp with ESMTP id aQ51ojSTtlQu6aQ51oalOo; Mon, 19 Sep 2022 23:21:36 +0000 X-Authority-Analysis: v=2.4 cv=YfOuWidf c=1 sm=1 tr=0 ts=6328f980 a=oHm12aVswOWz6TMtn9zYKg==:117 a=oHm12aVswOWz6TMtn9zYKg==:17 a=IkcTkHD0fZMA:10 a=pR-TdPcmRUgIbz0SJtUA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=QEXdDO2ut3YA:10 Message-ID: <311b666f-d1f2-7f1a-b31c-7131dd533feb@SystematicSw.ab.ca> Date: Mon, 19 Sep 2022 17:21:35 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Reply-To: newlib@sourceware.org Subject: Re: Fw: [PATCH 1/2] strftime.c(__strftime): add %i, %q, %v, tests; tweak %Z docs Content-Language: en-CA To: newlib@sourceware.org References: <20220917050005.5758-1-Brian.Inglis@SystematicSW.ab.ca> <20220917050005.5758-2-Brian.Inglis@SystematicSW.ab.ca> 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: MS4xfIr7frQMrlJZwQnHv2+Lyaedholfk7l/WynWlF2mzLQh57XvQ7a6yzNj8NHTAkEi8BtBsDE/18+eOaHsOE+ZwxC3FGJ5RqCKHOuXuK3UTQQ4cCv4DyzB pe3+1BQwZDa1LzHEQ6YAijFLqJMIsUPZ24zyG+M7dwJzBzZpToTw6vpBQoIfB2iXlDFasa+vIIVkIh3HQKHv85KwatXEYSfmkdg= X-Spam-Status: No, score=-1164.2 required=5.0 tests=BAYES_00,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,NICE_REPLY_A,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-09-19 09:51, C Howland wrote: > newlib/libc/time/strftime.c(__strftime): > %i year in century [00..99] Synonym for "%y". Non-POSIX extension. > [tm_year] > %q GNU quarter of the year (from `<<1>>' to `<<4>>') [tm_mon] > %v OSX/Ruby VMS/Oracle date "%d-%b-%Y". Non-POSIX extension. > [tm_mday, tm_mon, tm_year] > add %i %q %v tests > %Z clarify current time zone *abbreviation* not "name" [tm_isdst] > While the additions themselves nominally look good, all being extensions > they ought to be gated by the appropriate ifdefs, and the manual would > best mention what gates are needed to get them.  %q would be > __GNU_VISIBLE as the gate and _GNU_SOURCE for the user/manual, and I'd > guess probably __MISC_VISIBLE gate for the others (user action as noted > in sys/features.h). Those features are more appropriate for application build time feature support selection, not for library implementations. I checked and implementations (including BSD, and Cygwin strptime.cc) don't gate features, except by what the build config supports and desires: __CYGWIN__, __HAVE_LOCALE_INFO_EXTENDED__, __TM_GMTOFF, __TM_ZONE, _WANT_C99_TIME_FORMATS, MAKE_WCSFTIME, YEAR_BASE and strptime.c *#defines _GNU_SOURCE* before all #include-s. The overhead of the additions is minimal compared to existing conversions, the likely impact of issues with new conversions used in existing sources is low, and any use is defined as UB. -- 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.]