You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Julian Foad <ju...@wandisco.com> on 2010/12/22 12:36:27 UTC

Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

subversion/libsvn_repos/commit.c:648: no previous prototype for
'svn_repos__post_commit_error_str'

- Julian


blair@apache.org wrote:
> Add a private function that takes the error returned from
> svn_repos_fs_commit_txn() and builds a error message string containing
> either or both of the svn_fs_commit_txn() error and the
> SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped post-commit error.  The
> function skips over tracing errors.
> 
> * subversion/include/private/svn_repos_private.h
>   (svn_repos__post_commit_error_str):
>     New private function.
> 
> * subversion/libsvn_repos/commit.c
>   (svn_repos__post_commit_error_str):
>     Implement.
>   (close_edit):
>     Use svn_repos__post_commit_error_str() instead of processing the
>     SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error.
[...]

> Modified: subversion/trunk/subversion/include/private/svn_repos_private.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_repos_private.h?rev=1051763&r1=1051762&r2=1051763&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/include/private/svn_repos_private.h (original)
> +++ subversion/trunk/subversion/include/private/svn_repos_private.h Wed Dec 22 05:46:45 2010
> @@ -84,6 +84,25 @@ svn_repos__validate_prop(const char *nam
>                           const svn_string_t *value,
>                           apr_pool_t *pool);
>  
> +/**
> + * Given the error @a err from svn_repos_fs_commit_txn(), return an
> + * string containing either or both of the svn_fs_commit_txn() error
> + * and the SVN_ERR_REPOS_POST_COMMIT_HOOK_FAILED wrapped error from
> + * the post-commit hook.  Any error tracing placeholders in the error
> + * chain are skipped over.
> + *
> + * ### This method should not be necessary, but there are a few
> + * ### places, e.g. mod_dav_svn, where only a single error message
> + * ### string is returned to the caller and it is useful to have both
> + * ### error messages included in the message.
> + *
> + * Use @a pool to allocate the string in.
> + *
> + * @since New in 1.7.
> + */
> +const char *
> +svn_repos__post_commit_error_str(svn_error_t *err,
> +                                 apr_pool_t *pool);
>  
>  #ifdef __cplusplus
>  }
> 
> Modified: subversion/trunk/subversion/libsvn_repos/commit.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1051763&r1=1051762&r2=1051763&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_repos/commit.c (original)
> +++ subversion/trunk/subversion/libsvn_repos/commit.c Wed Dec 22 05:46:45 2010
> @@ -644,7 +644,56 @@ change_dir_prop(void *dir_baton,
>                                         name, value, pool);
>  }
>  
> +const char *
> +svn_repos__post_commit_error_str(svn_error_t *err,
> +                                 apr_pool_t *pool)
> +{
> +  svn_error_t *hook_err1, *hook_err2;
[...]

Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Blair Zajac <bl...@orcaware.com>.
On 12/22/10 1:53 PM, Hyrum K Wright wrote:
> On Wed, Dec 22, 2010 at 2:03 PM, Blair Zajac<bl...@orcaware.com>  wrote:
>> Lots of warnings in the build now.  I remember the days when we have a
>> warning free build.  It would be nice to have that back, but it would be a
>> bunch of work.
>
> It's because we've made the compile more strict about flagging
> warnings, not because we've introduced more warning-inducing code.
> But yah, fixing the warnings would be nice...

We have gotten soft about removing deprecation warnings.

Blair

Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Hyrum K Wright <hy...@hyrumwright.org>.
On Wed, Dec 22, 2010 at 2:03 PM, Blair Zajac <bl...@orcaware.com> wrote:
> Lots of warnings in the build now.  I remember the days when we have a
> warning free build.  It would be nice to have that back, but it would be a
> bunch of work.

It's because we've made the compile more strict about flagging
warnings, not because we've introduced more warning-inducing code.
But yah, fixing the warnings would be nice...

-Hyrum

Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Blair Zajac <bl...@orcaware.com>.
On 12/22/10 8:43 AM, Julian Foad wrote:
> On Wed, 2010-12-22, Blair Zajac wrote:
>> On 12/22/10 4:36 AM, Julian Foad wrote:
>>> subversion/libsvn_repos/commit.c:648: no previous prototype for
>>> 'svn_repos__post_commit_error_str'
>>
>> Thanks, fixed in r1051968.
>>
>> Which compiler are you using that gives this warning?
>
> GCC.
>
>> From the output of "make":
>
> [...]/libtool --tag=CC --silent --mode=link gcc  -Wno-system-headers
> -Wold-style-definition -Wdeclaration-after-statement -Wpointer-arith
> -Wwrite-strings -Wshadow -ansi -Wall -Wformat=2 -Wunused
> -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wno-multichar -Wredundant-decls -Wnested-externs
> -Wunreachable-code -Winline -Wno-long-long -g -DAPR_POOL_DEBUG -Wundef
> -Wendif-labels -Wcast-qual -Wno-deprecated-declarations
> -Wno-unreachable-code -Wno-format-nonliteral -pthread
> -D_LARGEFILE64_SOURCE -DNE_LFS -Werror=implicit-function-declaration
> -DSVN_DEBUG -DAP_DEBUG [...]
>
> (The first group of options are inserted by Subversion's configury, and
> my config/build/test script sets CFLAGS to "-g -O -DAPR_POOL_DEBUG
> -Wundef -Wendif-labels -Wcast-qual -Wno-deprecated-declarations
> -Wno-unreachable-code -Wno-format-nonliteral".)

Thanks, I've added these to my script.

Lots of warnings in the build now.  I remember the days when we have a warning 
free build.  It would be nice to have that back, but it would be a bunch of work.

Blair

Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Julian Foad <ju...@wandisco.com>.
Daniel Shahaf wrote:
> Julian Foad wrote on Wed, Dec 22, 2010 at 16:43:16 +0000:
> > GCC.
> > 
> > From the output of "make":
> > 
> > [...]/libtool --tag=CC --silent --mode=link gcc  -Wno-system-headers
> > -Wold-style-definition -Wdeclaration-after-statement -Wpointer-arith
> > -Wwrite-strings -Wshadow -ansi -Wall -Wformat=2 -Wunused
> > -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
> > -Wmissing-declarations -Wno-multichar -Wredundant-decls -Wnested-externs
> > -Wunreachable-code -Winline -Wno-long-long -g -DAPR_POOL_DEBUG -Wundef
> > -Wendif-labels -Wcast-qual -Wno-deprecated-declarations
> > -Wno-unreachable-code -Wno-format-nonliteral -pthread
> > -D_LARGEFILE64_SOURCE -DNE_LFS -Werror=implicit-function-declaration
> > -DSVN_DEBUG -DAP_DEBUG [...]
> > 
> > (The first group of options are inserted by Subversion's configury, and
> > my config/build/test script sets CFLAGS to "-g -O -DAPR_POOL_DEBUG
> > -Wundef -Wendif-labels
> 
> > -Wcast-qual
> 
> This one generates a couple dozen warnings for me....

Yup, me too.  We have eliminated many of these (mainly "casting away
'const'") warnings over the years.  The ones that are still present are
nigh on impossible to avoid; most of them are instances of correct code
that just can't be expressed cleanly within the rules of C "const"
syntax.

Personally, I prefer to enable this warning, because if I notice any new
instance of it appearing (and often I *do* notice, despite the noise
level), usually it is a useful indication that something is wrong.

But a warning-free build is also very useful, so not enabling it is also
a good choice.

- Julian


> > -Wno-deprecated-declarations -Wno-unreachable-code -Wno-format-nonliteral".)
> 
> With these three, I now have a warning-free build --- thanks!
> 
> (after r1052225, and modulo the svn-populate-node-origin issue from
> yesterday)


Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Julian Foad wrote on Wed, Dec 22, 2010 at 16:43:16 +0000:
> On Wed, 2010-12-22, Blair Zajac wrote:
> > On 12/22/10 4:36 AM, Julian Foad wrote:
> > > subversion/libsvn_repos/commit.c:648: no previous prototype for
> > > 'svn_repos__post_commit_error_str'
> > 
> > Thanks, fixed in r1051968.
> > 
> > Which compiler are you using that gives this warning?
> 
> GCC.
> 
> >From the output of "make":
> 
> [...]/libtool --tag=CC --silent --mode=link gcc  -Wno-system-headers
> -Wold-style-definition -Wdeclaration-after-statement -Wpointer-arith
> -Wwrite-strings -Wshadow -ansi -Wall -Wformat=2 -Wunused
> -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
> -Wmissing-declarations -Wno-multichar -Wredundant-decls -Wnested-externs
> -Wunreachable-code -Winline -Wno-long-long -g -DAPR_POOL_DEBUG -Wundef
> -Wendif-labels -Wcast-qual -Wno-deprecated-declarations
> -Wno-unreachable-code -Wno-format-nonliteral -pthread
> -D_LARGEFILE64_SOURCE -DNE_LFS -Werror=implicit-function-declaration
> -DSVN_DEBUG -DAP_DEBUG [...]
> 
> (The first group of options are inserted by Subversion's configury, and
> my config/build/test script sets CFLAGS to "-g -O -DAPR_POOL_DEBUG
> -Wundef -Wendif-labels

> -Wcast-qual

This one generates a couple dozen warnings for me....

> -Wno-deprecated-declarations -Wno-unreachable-code -Wno-format-nonliteral".)

With these three, I now have a warning-free build --- thanks!

(after r1052225, and modulo the svn-populate-node-origin issue from
yesterday)

> 
> - Julian
> 
> 

Daniel
(using gcc 4.3.2 on Debian)

Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Julian Foad <ju...@wandisco.com>.
On Wed, 2010-12-22, Blair Zajac wrote:
> On 12/22/10 4:36 AM, Julian Foad wrote:
> > subversion/libsvn_repos/commit.c:648: no previous prototype for
> > 'svn_repos__post_commit_error_str'
> 
> Thanks, fixed in r1051968.
> 
> Which compiler are you using that gives this warning?

GCC.

From the output of "make":

[...]/libtool --tag=CC --silent --mode=link gcc  -Wno-system-headers
-Wold-style-definition -Wdeclaration-after-statement -Wpointer-arith
-Wwrite-strings -Wshadow -ansi -Wall -Wformat=2 -Wunused
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wno-multichar -Wredundant-decls -Wnested-externs
-Wunreachable-code -Winline -Wno-long-long -g -DAPR_POOL_DEBUG -Wundef
-Wendif-labels -Wcast-qual -Wno-deprecated-declarations
-Wno-unreachable-code -Wno-format-nonliteral -pthread
-D_LARGEFILE64_SOURCE -DNE_LFS -Werror=implicit-function-declaration
-DSVN_DEBUG -DAP_DEBUG [...]

(The first group of options are inserted by Subversion's configury, and
my config/build/test script sets CFLAGS to "-g -O -DAPR_POOL_DEBUG
-Wundef -Wendif-labels -Wcast-qual -Wno-deprecated-declarations
-Wno-unreachable-code -Wno-format-nonliteral".)

- Julian


Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Julian Foad <ju...@wandisco.com>.
On Wed, 2010-12-22, Blair Zajac wrote:
> On 12/22/10 4:36 AM, Julian Foad wrote:
> > subversion/libsvn_repos/commit.c:648: no previous prototype for
> > 'svn_repos__post_commit_error_str'
> 
> Thanks, fixed in r1051968.
> 
> Which compiler are you using that gives this warning?

GCC.

>>From the output of "make":

[...]/libtool --tag=CC --silent --mode=link gcc  -Wno-system-headers
-Wold-style-definition -Wdeclaration-after-statement -Wpointer-arith
-Wwrite-strings -Wshadow -ansi -Wall -Wformat=2 -Wunused
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wno-multichar -Wredundant-decls -Wnested-externs
-Wunreachable-code -Winline -Wno-long-long -g -DAPR_POOL_DEBUG -Wundef
-Wendif-labels -Wcast-qual -Wno-deprecated-declarations
-Wno-unreachable-code -Wno-format-nonliteral -pthread
-D_LARGEFILE64_SOURCE -DNE_LFS -Werror=implicit-function-declaration
-DSVN_DEBUG -DAP_DEBUG [...]

(The first group of options are inserted by Subversion's configury, and
my config/build/test script sets CFLAGS to "-g -O -DAPR_POOL_DEBUG
-Wundef -Wendif-labels -Wcast-qual -Wno-deprecated-declarations
-Wno-unreachable-code -Wno-format-nonliteral".)

- Julian



Re: svn commit: r1051763 - in /subversion/trunk/subversion: include/private/svn_repos_private.h libsvn_repos/commit.c mod_dav_svn/version.c

Posted by Blair Zajac <bl...@orcaware.com>.
On 12/22/10 4:36 AM, Julian Foad wrote:
> subversion/libsvn_repos/commit.c:648: no previous prototype for
> 'svn_repos__post_commit_error_str'

Thanks, fixed in r1051968.

Which compiler are you using that gives this warning?

Blair