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

Re: svn commit: r1096150 - /subversion/trunk/subversion/svnadmin/main.c

From: Hyrum K Wright <hyrum_at_hyrumwright.org>
Date: Sat, 23 Apr 2011 19:57:34 -0500

On Sat, Apr 23, 2011 at 8:59 AM, <stefan2_at_apache.org> wrote:
> Author: stefan2
> Date: Sat Apr 23 13:59:23 2011
> New Revision: 1096150
>
> URL: http://svn.apache.org/viewvc?rev=1096150&view=rev
> Log:
> * subversion/svnadmin/main.c
>  (subcommand_crashtest): silence 'not all control paths return a value'
>   warning in VisualStudio
>
> Modified:
>    subversion/trunk/subversion/svnadmin/main.c
>
> Modified: subversion/trunk/subversion/svnadmin/main.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnadmin/main.c?rev=1096150&r1=1096149&r2=1096150&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/svnadmin/main.c (original)
> +++ subversion/trunk/subversion/svnadmin/main.c Sat Apr 23 13:59:23 2011
> @@ -2001,4 +2001,7 @@ subcommand_crashtest(apr_getopt_t *os, v
>
>   SVN_ERR(open_repos(&repos, opt_state->repository_path, pool));
>   abort();
> +
> +  /* merely silence a compiler warning (this will never be executed) */
> +  return SVN_NO_ERROR;
>  }
>
>

Heh. Now gcc emits an unreachable code error:
subversion/svnadmin/main.c: In function ‘subcommand_crashtest’:
subversion/svnadmin/main.c:2006: warning: will never be executed

I suppose we could if-def the above line depending on the compiler.
If we *don't* want to play such games, my heavily biased bikeshed
would be to omit the admittedly superfluous line.

-Hyrum
Received on 2011-04-24 02:58:04 CEST

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.