[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1074461 - in /subversion/trunk: subversion/libsvn_subr/dirent_uri.c subversion/libsvn_wc/relocate.c tools/client-side/svnmucc/svnmucc.c

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Fri, 25 Feb 2011 14:06:59 +0200

It was discussed a few months ago, conclusion was that the casts are
necessary because they don't happen automatically for varargs functions
(like apr_pstrcat()).

Greg Stein wrote on Fri, Feb 25, 2011 at 07:01:38 -0500:
> What?! ... what is this? I've never seen "missing sentinel". This just
> seems to complicate the code for the sake of a compiler. And one that
> historically has not been a problem for us.
>
> ??
>
> On Fri, Feb 25, 2011 at 05:01, <stsp_at_apache.org> wrote:
> > Author: stsp
> > Date: Fri Feb 25 10:01:57 2011
> > New Revision: 1074461
> >
> > URL: http://svn.apache.org/viewvc?rev=1074461&view=rev
> > Log:
> > Get rid of a few "missing sentinel" warnings from calls to apr_pstrcat()
> > by explicitly casting NULL to the expected pointer type.
> >
> > * subversion/libsvn_subr/dirent_uri.c
> >  (svn_fspath__canonicalize,
> >   svn_fspath__get_longest_ancestor): Cast to (char *).
> >
> > * subversion/libsvn_wc/relocate.c
> >  (svn_wc_relocate4): Same.
> >
> > * tools/client-side/svnmucc/svnmucc.c
> >  (main): Same.
> >
> > Modified:
> >    subversion/trunk/subversion/libsvn_subr/dirent_uri.c
> >    subversion/trunk/subversion/libsvn_wc/relocate.c
> >    subversion/trunk/tools/client-side/svnmucc/svnmucc.c
> >
> > Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=1074461&r1=1074460&r2=1074461&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original)
> > +++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Fri Feb 25 10:01:57 2011
> > @@ -2440,7 +2440,8 @@ svn_fspath__canonicalize(const char *fsp
> >   if ((fspath[0] == '/') && (fspath[1] == '\0'))
> >     return "/";
> >
> > -  return apr_pstrcat(pool, "/", svn_relpath_canonicalize(fspath, pool), NULL);
> > +  return apr_pstrcat(pool, "/", svn_relpath_canonicalize(fspath, pool),
> > +                     (char *)NULL);
> >  }
> >
> >
> > @@ -2571,7 +2572,7 @@ svn_fspath__get_longest_ancestor(const c
> >                        svn_relpath_get_longest_ancestor(fspath1 + 1,
> >                                                         fspath2 + 1,
> >                                                         result_pool),
> > -                       NULL);
> > +                       (char *)NULL);
> >
> >   assert(svn_fspath__is_canonical(result));
> >   return result;
> >
> > Modified: subversion/trunk/subversion/libsvn_wc/relocate.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/relocate.c?rev=1074461&r1=1074460&r2=1074461&view=diff
> > ==============================================================================
> > --- subversion/trunk/subversion/libsvn_wc/relocate.c (original)
> > +++ subversion/trunk/subversion/libsvn_wc/relocate.c Fri Feb 25 10:01:57 2011
> > @@ -146,7 +146,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
> >   if (old_url_len == from_len)
> >     new_url = to;
> >   else
> > -    new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, NULL);
> > +    new_url = apr_pstrcat(scratch_pool, to, old_url + from_len, (char *)NULL);
> >   if (! svn_path_is_url(new_url))
> >     return svn_error_createf(SVN_ERR_WC_INVALID_RELOCATION, NULL,
> >                              _("Invalid relocation destination: '%s' "
> >
> > Modified: subversion/trunk/tools/client-side/svnmucc/svnmucc.c
> > URL: http://svn.apache.org/viewvc/subversion/trunk/tools/client-side/svnmucc/svnmucc.c?rev=1074461&r1=1074460&r2=1074461&view=diff
> > ==============================================================================
> > --- subversion/trunk/tools/client-side/svnmucc/svnmucc.c (original)
> > +++ subversion/trunk/tools/client-side/svnmucc/svnmucc.c Fri Feb 25 10:01:57 2011
> > @@ -1071,7 +1071,8 @@ main(int argc, const char **argv)
> >                                                url), pool);
> >               /* ### These relpaths are already URI-encoded. */
> >               url = apr_pstrcat(pool, root_url, "/",
> > -                                svn_relpath_canonicalize(url, pool), NULL);
> > +                                svn_relpath_canonicalize(url, pool),
> > +                                (char *)NULL);
> >             }
> >           url = sanitize_url(url, pool);
> >           action->path[j] = url;
> >
> >
> >
Received on 2011-02-25 13:12:25 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.