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

Re: [PATCH] compile fs-test.c with non-gcc compiler

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2002-09-19 10:56:33 CEST

On Thu, Sep 12, 2002 at 11:59:35PM +0100, Philip Martin wrote:
> "D. J. Hagberg" <dh114027@central.sun.com> writes:
>
> > Index: subversion/tests/libsvn_fs/fs-test.c
> > ===================================================================
> > --- subversion/tests/libsvn_fs/fs-test.c
> > +++ subversion/tests/libsvn_fs/fs-test.c Mon Sep 9 13:38:01 2002
> > @@ -5167,18 +5167,18 @@
> > {
> > for (j = 0; j < 16; j++)
> > {
> > - struct path_rev_t pr1 = path_revs[i];
> > - struct path_rev_t pr2 = path_revs[j];
> > + struct path_rev_t *pr1 = &(path_revs[i]);
> > + struct path_rev_t *pr2 = &(path_revs[j]);
>
> Out of interest, does using const
>
> > + const struct path_rev_t pr1 = path_revs[i];
> > + const struct path_rev_t pr2 = path_revs[j];
>
> work?

Nope.

What does work is removing the const from the rev field in
path_rev_t. I'll commit that and if anyone has anything better,
let me know first and I'll try it out with forte. It doesn't
seem to produce a warning with gcc (on Darwin), and it's a much
easier solution than D.J.'s original suggestion.

For more on non-modifiable lvalues:

http://www.embedded.com/story/OEG20010618S0075

Based on my reading of that, it seems that forte *is* correct on
producing this warning. But, I could be wrong and we need to submit
a bug report to Sun.

Non-compilable code is a sure way to make me not happy. -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 19 10:57:15 2002

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.