From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36680 invoked by alias); 24 Jul 2017 22:49:02 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 35882 invoked by uid 89); 24 Jul 2017 22:49:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=demanding, scratching, our X-HELO: smtp-out-no.shaw.ca Received: from smtp-out-no.shaw.ca (HELO smtp-out-no.shaw.ca) (64.59.134.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Jul 2017 22:49:00 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with SMTP id Zm9qdLNNRM9gtZm9rdSUHy; Mon, 24 Jul 2017 16:48:59 -0600 X-Authority-Analysis: v=2.2 cv=a+JAzQaF c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=Km5KNKZfAgWv-1nbDTgA:9 a=QEXdDO2ut3YA:10 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: Cygwin strptime() is missing "%s" which strftime() has To: cygwin@cygwin.com References: From: Brian Inglis Message-ID: Date: Mon, 24 Jul 2017 22:51:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfOvOZ6JdapxXn1evaO1p97UmcLMRUZT6igQLsMgLosjlxmpq88O3Eebfuc6YByGWpc20URBOK1pdRXpEoQTnpRXHcJDwp+DvE5GdkOF6pz4xV7ZAs/mT nZKJRyYkdGmpzJi+D55SVxRAr32baZcZI+ip/k1w65paygae1zkBkiF5ctdhuiOaqvY3dTTvQayG1w== X-IsSubscribed: yes X-SW-Source: 2017-07/txt/msg00334.txt.bz2 On 2017-07-24 15:48, Eric Blake wrote: > On 07/24/2017 04:28 PM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: >>> then its use of %s in either of those functions constitutes a _bug_ >> >> Oh really? Is that why "%s" was added to Cygwin's strftime() lately? > > Your mailer is breaking up threads, which is making it very annoying to > follow where your replies are landing. > > strftime() has been formatting %s since Oct 2015 (if you can call that > "lately"). In fact, you made me check git history: it was not me that > added it (like I thought, so I must have added it in gnulib instead); > but Brian - in fact, the same Brian who is now working on adding %s to > strptime(). > > The point remains: if you want your program to be portable, you should > not use %s. But if your program is okay with demanding a GNU/Linux > environment rather than sticking to portable code, then Cygwin still > tries to cater to that by providing as many GNU/Linux extensions as > possible, and pointing out where we fall short is appreciated. But > still, someone has to code it, this is a volunteer effort, and we tend > to scratch our own itches. The fact that strptime() lagged strftime() > by nearly 2 years in adding %s support is par for the course. It's not > worth complaining about, and if you want faster action, then submit > patches yourself instead of asking others to do it for you. My itch is that it doesn't work in dateutils strptime(1), so the hope is that if %s (also %F) works in newlib libc strptime(3), that will get it working in dateutils strptime(1), as it does in coreutils date(1), or I'll have to do some more scratching. Of course, C code could just convert the seconds strings to some BIG_INT, put it in a time_t, and use localtime(3) or gmtime(3) to get a struct tm for use in strftime(3). Shell scripts could use coreutils date(1) instead of dateutils strptime(1) to convert time_t using %s (and more). It would be great if all the time utilities and functions could support a consistent set (GNU) of time conversion specifications. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple