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

Re: svn commit: r26614 - in trunk/subversion/bindings/swig: include ruby/libsvn_swig_ruby ruby/svn

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2007-09-17 02:56:21 CEST

Hi Joe,

2007/9/17, Joe Swatosh <joe.swatosh@gmail.com>:
> > > > > Author: joeswatosh
> > > > > Date: Sat Sep 15 12:46:05 2007
> > > > > New Revision: 26614
> > > > >
> > > > I think it's better that we get a compiler error.
> > > >
> > > > If we use a "getter" function and the svn_wc_get_file_t
> > > > interface is changed, we will not get correct behavior on
> > > > runtime. I think it's easy to detect incorrect behavior if
> > > > a compiler reports a error rather than tests report a
> > > > runtime error.
> > >
> > > I know these aren't supposed to change after a release, but we had one
> > > change that was under development and it was hard for me to find. I
> > > think this way is better while things might change. After release it
> > > doesn't matter so much.
> >
> > Can you find the interface change easily with this change?
> > If it's true this change is OK.
> >
> > But It seems that it's not true. Because you didn't write tests
> > for this change. I'm afraid that the interface change is ignored
> > and we forget to follow the interface change when release.
> >

> I misunderstood. I thought you liked the new "_getter()" idiom because it
> would cause the compiler to let us know earlier. Here is my experience:

Ah, no. I don't like it.

> To establish a base, this is what a normal build looks like for me today:
...
> If I make this change (which causes our callback to no longer match the
> svn_wc_conflict_resolver_func_t defined interface):
...
> My build results look like:
...
> IOW, no different from the build without the error.

I think this should be reported in subversion/bindings/swig/ruby/svn_wc.c.
Because the type mismatch is caused when we assign
svn_swig_rb_conflict_resolver_func() to svn_wc_conflict_resolver_func_t
variable. On my environment, I'm using gcc, the following warning is
reported:

  subversion/bindings/swig/ruby/svn_wc.c: In function
'_wrap_svn_wc_get_update_editor3':
  subversion/bindings/swig/ruby/svn_wc.c:14535: warning: assignment
from incompatible pointer type

And subversion/bindings/swig/ruby/svn_wc.c:14535 is the following:

  arg11 = svn_swig_rb_conflict_resolver_func;

And here is arg11 decralation:

  svn_wc_conflict_resolver_func_t arg11 = (svn_wc_conflict_resolver_func_t) 0 ;

If VC compiler doesn't report this, _getter() approach is good for me too.
If VC compiler reports this, it seems that _getter() approach is needless...

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Sep 17 02:52:40 2007

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.