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

Re: [PATCH] initialize some variables in test to prevent -Wmaybe-uninitialized

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 16 Nov 2013 10:32:18 +0200

Daniel Shahaf wrote on Sat, Nov 16, 2013 at 10:29:34 +0200:
> Andreas Stieger wrote on Sat, Nov 16, 2013 at 00:08:40 +0000:
> > +++ subversion/tests/libsvn_fs/fs-test.c (working copy)
> > @@ -1020,7 +1020,7 @@ static svn_error_t *
> > check_entry_present(svn_fs_root_t *root, const char *path,
> > const char *name, apr_pool_t *pool)
> > {
> > - svn_boolean_t present;
> > + svn_boolean_t present = false;
> > SVN_ERR(check_entry(root, path, name, &present, pool));
> >
> > if (! present)
> > @@ -1037,7 +1037,7 @@ static svn_error_t *
> > check_entry_absent(svn_fs_root_t *root, const char *path,
> > const char *name, apr_pool_t *pool)
> > {
> > - svn_boolean_t present;
> > + svn_boolean_t present = true;
> > SVN_ERR(check_entry(root, path, name, &present, pool));
> >
> > if (present)
>
> Personally I'd consider a tristate here, to allow the initialization to
> be the same regardless of the sense of the condition in the 'if'.

In case it's not clear, I mean:

   svn_tristate_t present = svn_tristate_unknown;

and then changing the callee and condition in similar fashion.
Received on 2013-11-16 09:32:59 CET

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