Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-07 Thread Branko Čibej
On 07.08.2014 14:35, Stefan Sperling wrote: > On Thu, Aug 07, 2014 at 02:27:15PM +0200, Branko Čibej wrote: >> On 07.08.2014 08:52, Stefan Sperling wrote: >>> On Thu, Aug 07, 2014 at 01:34:40AM +0200, Branko Čibej wrote: On 06.08.2014 23:23, Stefan Sperling wrote: > How about I commit my p

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-07 Thread Stefan Sperling
On Thu, Aug 07, 2014 at 02:27:15PM +0200, Branko Čibej wrote: > On 07.08.2014 08:52, Stefan Sperling wrote: > > On Thu, Aug 07, 2014 at 01:34:40AM +0200, Branko Čibej wrote: > >> On 06.08.2014 23:23, Stefan Sperling wrote: > >>> How about I commit my patch, and then someone else (you? Bert?) tunes

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-07 Thread Branko Čibej
On 07.08.2014 08:52, Stefan Sperling wrote: > On Thu, Aug 07, 2014 at 01:34:40AM +0200, Branko Čibej wrote: >> On 06.08.2014 23:23, Stefan Sperling wrote: >>> How about I commit my patch, and then someone else (you? Bert?) tunes >>> the implementations of svn_cstring_atoi*, perhaps reusing code fro

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-07 Thread Ivan Zhakov
On 6 August 2014 19:57, Stefan Sperling wrote: > On Wed, Aug 06, 2014 at 07:31:04PM +0400, Ivan Zhakov wrote: >> apr_get_os_error() uses GetLastError() on Windows, while strtol() uses >> standard errno for error code. > > So you're saying code like this works on Windows, and I shouldn't > be using

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Stefan Sperling
On Thu, Aug 07, 2014 at 01:34:40AM +0200, Branko Čibej wrote: > On 06.08.2014 23:23, Stefan Sperling wrote: > > How about I commit my patch, and then someone else (you? Bert?) tunes > > the implementations of svn_cstring_atoi*, perhaps reusing code from > > svn__strto* but keeping the API promises

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Branko Čibej
On 06.08.2014 23:23, Stefan Sperling wrote: > How about I commit my patch, and then someone else (you? Bert?) tunes > the implementations of svn_cstring_atoi*, perhaps reusing code from > svn__strto* but keeping the API promises intact? You'd be silently changing the semantics of public APIs. Thes

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Stefan Sperling
On Wed, Aug 06, 2014 at 09:05:41PM +0200, Stefan Fuhrmann wrote: > It seems to me that the correct approach would be > adding overflow checks to svn__strto*. How do you intend to do this correctly? The way I see it, we need to change the svn__strto* API for this because currently there is no way

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Stefan Fuhrmann
On Wed, Aug 6, 2014 at 8:05 PM, Stefan Sperling wrote: > On Wed, Aug 06, 2014 at 07:18:49PM +0200, Branko Čibej wrote: > > On 06.08.2014 18:47, Bert Huijben wrote: > > > Some time ago I switched a few of the calls mentioned here around to > > > get a huge performance improvement on Windows. The s

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Stefan Sperling
On Wed, Aug 06, 2014 at 07:18:49PM +0200, Branko Čibej wrote: > On 06.08.2014 18:47, Bert Huijben wrote: > > Some time ago I switched a few of the calls mentioned here around to > > get a huge performance improvement on Windows. The standard integer > > parse functions start by skipping whitespace,

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Branko Čibej
On 06.08.2014 18:47, Bert Huijben wrote: > Some time ago I switched a few of the calls mentioned here around to > get a huge performance improvement on Windows. The standard integer > parse functions start by skipping whitespace, and only then parse the > integer. But whatever is whitespace is loca

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Bert Huijben
Some time ago I switched a few of the calls mentioned here around to get a huge performance improvement on Windows. The standard integer parse functions start by skipping whitespace, and only then parse the integer. But whatever is whitespace is locale dependent, and checking for that from the C

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Stefan Sperling
On Wed, Aug 06, 2014 at 07:31:04PM +0400, Ivan Zhakov wrote: > apr_get_os_error() uses GetLastError() on Windows, while strtol() uses > standard errno for error code. So you're saying code like this works on Windows, and I shouldn't be using apr_get/set_os_error() for strtol()? errno =

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Ivan Zhakov
On 6 August 2014 19:11, Stefan Sperling wrote: > I'd like to remove svn__strtol() and svn__strtoul(). > > Let's not get performance and micro-optimisation in the way of error checking. > Even if the input does not come from the network or cannot for any other > reason be inherently malicious it mi

Re: [PATCH] remove svn__strtol() and svn__strtoul()

2014-08-06 Thread Branko Čibej
On 06.08.2014 17:11, Stefan Sperling wrote: > I'd like to remove svn__strtol() and svn__strtoul(). > > Let's not get performance and micro-optimisation in the way of error checking. +1. I suggest that we should take a good look at the other "optimized" itoa-like functions in in that header, too.