You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Blair Zajac <bl...@orcaware.com> on 2009/11/25 01:15:38 UTC
Re: svn commit: r883916 - in /subversion/trunk/subversion: libsvn_subr/path.c
libsvn_subr/utf.c libsvn_subr/xml.c svndumpfilter/main.c
stsp@apache.org wrote:
> Author: stsp
> Date: Tue Nov 24 23:03:26 2009
> New Revision: 883916
>
> URL: http://svn.apache.org/viewvc?rev=883916&view=rev
> Log:
> Replace use of sprintf() with snprintf() everywhere expect within
> #ifdef WIN32 since I can't test that.
> In all these cases, sprintf() was used correctly, but my compiler
> doesn't know that and prints warnings anyway.
Why not use apr_snprintf()?
Blair
Re: svn commit: r883916 - in /subversion/trunk/subversion:
libsvn_subr/path.c libsvn_subr/utf.c libsvn_subr/xml.c svndumpfilter/main.c
Posted by Julian Foad <ju...@btopenworld.com>.
Branko Čibej wrote:
> Julian Foad wrote:
> > snprintf was introduced in the C'99 standard, so officially we shouldn't
> > assume we can use it, and a quick grep indicates we didn't use it until
> > now. But it's very likely that any non-C'99 systems that Subversion is
> > built on (Microsoft's, for one) provide it anyway.
>
> But since we do have apr_snprintf, there's no need to suddenly require
> the target platform to provide snprintf.
Sure. Changed in r884119.
- Julian
Re: svn commit: r883916 - in /subversion/trunk/subversion: libsvn_subr/path.c
libsvn_subr/utf.c libsvn_subr/xml.c svndumpfilter/main.c
Posted by Branko Čibej <br...@xbc.nu>.
Julian Foad wrote:
> Stefan Sperling wrote:
>
>> On Tue, Nov 24, 2009 at 04:15:38PM -0800, Blair Zajac wrote:
>>
>>> stsp@apache.org wrote:
>>>
>>>> Author: stsp
>>>> Date: Tue Nov 24 23:03:26 2009
>>>> New Revision: 883916
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=883916&view=rev
>>>> Log:
>>>> Replace use of sprintf() with snprintf() everywhere expect within
>>>> #ifdef WIN32 since I can't test that.
>>>> In all these cases, sprintf() was used correctly, but my compiler
>>>> doesn't know that and prints warnings anyway.
>>>>
>>> Why not use apr_snprintf()?
>>>
>> We could use it, yeah. I simply didn't know about it.
>>
>
> snprintf was introduced in the C'99 standard, so officially we shouldn't
> assume we can use it, and a quick grep indicates we didn't use it until
> now. But it's very likely that any non-C'99 systems that Subversion is
> built on (Microsoft's, for one) provide it anyway.
>
But since we do have apr_snprintf, there's no need to suddenly require
the target platform to provide snprintf.
-- Brane
Re: svn commit: r883916 - in /subversion/trunk/subversion:
libsvn_subr/path.c libsvn_subr/utf.c libsvn_subr/xml.c svndumpfilter/main.c
Posted by Julian Foad <ju...@btopenworld.com>.
Stefan Sperling wrote:
> On Tue, Nov 24, 2009 at 04:15:38PM -0800, Blair Zajac wrote:
> > stsp@apache.org wrote:
> > >Author: stsp
> > >Date: Tue Nov 24 23:03:26 2009
> > >New Revision: 883916
> > >
> > >URL: http://svn.apache.org/viewvc?rev=883916&view=rev
> > >Log:
> > >Replace use of sprintf() with snprintf() everywhere expect within
> > >#ifdef WIN32 since I can't test that.
> > >In all these cases, sprintf() was used correctly, but my compiler
> > >doesn't know that and prints warnings anyway.
> >
> > Why not use apr_snprintf()?
>
> We could use it, yeah. I simply didn't know about it.
snprintf was introduced in the C'99 standard, so officially we shouldn't
assume we can use it, and a quick grep indicates we didn't use it until
now. But it's very likely that any non-C'99 systems that Subversion is
built on (Microsoft's, for one) provide it anyway.
- Julian
Re: svn commit: r883916 - in /subversion/trunk/subversion:
libsvn_subr/path.c libsvn_subr/utf.c libsvn_subr/xml.c
svndumpfilter/main.c
Posted by Stefan Sperling <st...@elego.de>.
On Tue, Nov 24, 2009 at 04:15:38PM -0800, Blair Zajac wrote:
> stsp@apache.org wrote:
> >Author: stsp
> >Date: Tue Nov 24 23:03:26 2009
> >New Revision: 883916
> >
> >URL: http://svn.apache.org/viewvc?rev=883916&view=rev
> >Log:
> >Replace use of sprintf() with snprintf() everywhere expect within
> >#ifdef WIN32 since I can't test that.
> >In all these cases, sprintf() was used correctly, but my compiler
> >doesn't know that and prints warnings anyway.
>
> Why not use apr_snprintf()?
We could use it, yeah. I simply didn't know about it.
Stefan