Re: Cygwin strptime() is missing "%s" which strftime() has

2017-08-29 Thread Brian Inglis
On 2017-07-25 10:47, Brian Inglis wrote: > On 2017-07-24 17:18, Kaz Kylheku wrote: >> On 24.07.2017 15:51, Brian Inglis wrote: >>> On 2017-07-24 15:02, Hans-Bernhard Bröker wrote: Am 24.07.2017 um 04:09 schrieb Lavrentiev, Anton (NIH/NLM/NCBI) [C]: > rather it's a question about porta

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-25 Thread Brian Inglis
On 2017-07-24 17:18, Kaz Kylheku wrote: > On 24.07.2017 15:51, Brian Inglis wrote: >> On 2017-07-24 15:02, Hans-Bernhard Bröker wrote: >>> Am 24.07.2017 um 04:09 schrieb Lavrentiev, Anton (NIH/NLM/NCBI) [C]: >>> rather it's a question about portability of code that uses %s for both functi

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Kaz Kylheku
On 24.07.2017 15:51, Brian Inglis wrote: On 2017-07-24 15:02, Hans-Bernhard Bröker wrote: Am 24.07.2017 um 04:09 schrieb Lavrentiev, Anton (NIH/NLM/NCBI) [C]: rather it's a question about portability of code that uses %s for both functions and expects it to work unchanged in the Cygwin environ

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Brian Inglis
On 2017-07-24 15:02, Hans-Bernhard Bröker wrote: > Am 24.07.2017 um 04:09 schrieb Lavrentiev, Anton (NIH/NLM/NCBI) [C]: > >> rather it's a question about portability of code that >> uses %s for both functions and expects it to work unchanged in the >> Cygwin environment. > > And the answer to t

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Brian Inglis
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, w

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Eric Blake
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

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C]
> 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? Thanks again for your input. Anton Lavrentiev Contractor NIH/NLM/NCBI -- Problem reports: http://cygwin.com/problems.html FAQ: htt

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Hans-Bernhard Bröker
Am 24.07.2017 um 04:09 schrieb Lavrentiev, Anton (NIH/NLM/NCBI) [C]: rather it's a question about portability of code that uses %s for both functions and expects it to work unchanged in the Cygwin environment. And the answer to that question is: such code _is_not_portable_, and therefore th

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Kaz Kylheku
On 23.07.2017 19:09, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: But that's just scanning a decimal integer to time_t. It's not a question of whether I can or can't convert a string into an integer, rather it's a question about portability of code that uses %s for both functions and expects it

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C]
> Demand. I patches strftime to add %s because Coreutils wanted it. But > coreutils doesn't use strptime, so I had no reason to add it. Well, I was bringing up a point of API inconsistency, hoping that it'd serve as an implicit request for an improvement so that strptime() gets its "%s"... May

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Eric Blake
On 07/24/2017 08:24 AM, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: But that's just scanning a decimal integer to time_t. >>> >>> It's not a question of whether I can or can't convert a string into an >>> integer, rather it's a question about portability of code that uses %s > >> I see your p

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C]
> > > But that's just scanning a decimal integer to time_t. > > > > It's not a question of whether I can or can't convert a string into an > > integer, rather it's a question about portability of code that uses %s > I see your point but... "portability" is kind of the wrong expression > here. If

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-24 Thread Corinna Vinschen
On Jul 24 02:09, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: > > But that's just scanning a decimal integer to time_t. > > It's not a question of whether I can or can't convert a string into an > integer, rather it's a question about portability of code that uses %s I see your point but... "porta

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-23 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C]
> But that's just scanning a decimal integer to time_t. It's not a question of whether I can or can't convert a string into an integer, rather it's a question about portability of code that uses %s for both functions and expects it to work unchanged in the Cygwin environment. Also, strptime()

Re: Cygwin strptime() is missing "%s" which strftime() has

2017-07-23 Thread Kaz Kylheku
On 22.07.2017 13:48, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote: Hello, It looks like Cygwin implementation of strptime(3) cannot understand the "%s" format (seconds since Jan 1, 1970 UTC), which strftime() can. But that's just scanning a decimal integer to time_t. Where implemented, how does

Cygwin strptime() is missing "%s" which strftime() has

2017-07-22 Thread Lavrentiev, Anton (NIH/NLM/NCBI) [C]
Hello, It looks like Cygwin implementation of strptime(3) cannot understand the "%s" format (seconds since Jan 1, 1970 UTC), which strftime() can. When I test the same code of Linux, it appears to work correctly. Cygwin: $ gcc -Wall -o timetest timetest.c $ ./timetest 1500755837 -> 1500755837 C