From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 299B43856DC0 for ; Fri, 21 Oct 2022 12:12:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 299B43856DC0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666354367; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=PxO9yufvF0TaN+1fTRN8AY8IyoNhTezQiuVl56iEHfo=; b=N+35uCHitqzDCLm3WHAQx/UWgapsGjYUy8de0If3IXnfhfR5SeHxPMfQW+Ky/DIfPPlcDo upAsIoEFE6XX2ImsszgBYoavIxP5/QX3h7ls3NCibGEaFMllU3Bhpw94eIkICW+HxZntIk GaBdEOXtqMAKUwhSNHnYqu8GFuFMlEE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-150-5mAOYbmOPTKH5upYadP4RA-1; Fri, 21 Oct 2022 08:12:46 -0400 X-MC-Unique: 5mAOYbmOPTKH5upYadP4RA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EE3A6811E75 for ; Fri, 21 Oct 2022 12:12:45 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.193.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7425249BB60 for ; Fri, 21 Oct 2022 12:12:44 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id 19B9EA80A35; Fri, 21 Oct 2022 14:12:43 +0200 (CEST) Date: Fri, 21 Oct 2022 14:12:43 +0200 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: Fw: [PATCH 1/2] strftime.c(__strftime): add %i, %q, %v, tests; tweak %Z docs Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <20220917050005.5758-1-Brian.Inglis@SystematicSW.ab.ca> <20220917050005.5758-2-Brian.Inglis@SystematicSW.ab.ca> <24f6dd02-57a6-48c6-eb16-cc8bed524b1f@SystematicSw.ab.ca> MIME-Version: 1.0 In-Reply-To: <24f6dd02-57a6-48c6-eb16-cc8bed524b1f@SystematicSw.ab.ca> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 Oct 20 16:07, Brian Inglis wrote: > On 2022-10-18 08:03, Corinna Vinschen wrote: > > On Sep 19 11:51, C Howland wrote: > > > On Saturday, September 17, 2022 1:00 AM, Brian Inglis 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] > > > > --- > > > > newlib/libc/time/strftime.c | 67 +++++++++++++++++++++++++++++++++++-- > > > > 1 file changed, 64 insertions(+), 3 deletions(-) > > > - %i: Where is used and documented? I don't see this in glibc, not even > > in the latest from the glibc git repo. > > Some portable language implementations for non-Unix platforms that I came > across and documented but did not keep track of, and now can't find! So we don't have that in either BSD, nor GNU, nor POSIX, but only in other non-POSIX platforms. Hmm. Along these lines, we could also make a case for supporting Microsoft's %I64 printf format and I'm not so hot on that... For the time being, please let's drop %i. Defining it now may result in accidental collisions with the POSIX standard, should it get extended. > > - %q: Ditto. For a GNU extension, it's surprisingly absent from the > > most recent glibc code, or do I miss something? > > Looks like this may have been lost in the discussion: > > https://inbox.sourceware.org/libc-alpha/2f5f737e-2e42-08c6-ae2b-33aab798a1d9@draigBrady.com/ > > but as he says, it was already in gnulib, and made it into date the same month: > > https://git.savannah.gnu.org/cgit/coreutils.git/diff/?id=30012b290facf66551cdf395ace397903d00483d Ok, that's fine then. > > - %v: OSX/Ruby? Isn't that already gone? Also, it introduces another > > ambiguous date format where %F or equivalent should be used instead. > > All the BSDs, Darwin, Oracle, and Ruby support it: it is localized, but not > ambiguous, as it's dd-Mon-yyyy. I found it in all three BSDs with a comment /* ** From Arnold Robbins' strftime version 3.0: ** "date as dd-bbb-YYYY" ** (ado, 1993-05-24) */ Also, it's defined as a recursion with the format "%e-%b-%Y", unconditionally (no padding, etc). Maybe we should replicate that verbatim (including the comment) to keep in line with BSD. Also, the BSDs do *not* define %v in strptime, so I think we shouldn't do this either. It may accidentally collide with a standards extension, just as %i. Thanks, Corinna