[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Coda on Alpha?



On Thu, 15 Apr 1999, Wai-Sun Chia wrote:

> Folks,
> After building the coda.o on my Alpha, I tried to build the server and
> client package (I'm on Debian/Alpha 2.1)..
> 
> But the build bombs out.
> I'm quite competent in C but I'm afraid I'm out of my league here with
> C++ stuff...
> Any C++ guru running Alpha here?

I think I can explain...or at least try (I do know what's going on but
whether I can word it so that people can understand is unknown :-)

> resforce.cc: In function `int RuntExists(struct ViceVersionVector **,
> int, int *, int *)':
> resforce.cc:718: call of overloaded `IsRunt (ViceVersionVector *&)' is
> ambiguous
> resforce.cc:707: candidates are: IsRunt(ViceVersionVector *)
> /usr/src/coda-5.2.0/include/inconsist.h:83:                 IsRunt(vv_t
> *)

In C++, you can "overload" a function, meaning that you can actually make
two functions with the same name providing that they accept different
arguments (for example: test(int x) and test(long x) can both exist in the
same code and each will work depending on what type of argument is passed
to test's 'x' var.  It's actually a really neat concept and VERY handy
(wish we had it in C, actually).

Anyway, what's going on above is that the function RuntExists is calling
IsRunt with an argument of the type ViceVersionVector.  Well, the same
source code file (at line 707) defines an IsRunt() function that accepts
ViceVersionVector arguments, and I believe was meant to overload the
default IsRunt() function which presumably wouldn't accept arguments of
that type before.  The problem is, according to inconsist.h on line 83,
there is another definition of the function IsRunt() that accepts
arguments of type vv_t.

Now you may think that ViceVersionVector != vv_t, and that wouldn't be a
bad assumption (I wouldn't normally think they were the same either), but
thinking about some programmers' naming conventions lead me to believe
that the name 'vv_t' actually means "version vector type" or "vice
version type" (I'd pick the former).  If that's true, they you can
probably find a line somewhere in the source that defines type vv_t as
being equal to ViceVersionVector (or vice versa), which would break
overloading there since both functions would be called in the same
instances (or they could even both be defined as ints, which might also
cause overloading problems on some compilers...dunno about ANSI C++ right
now..no books here).

In short (too late, right :-), look for what ViceVersionVector and vv_t
actually represent and see if the types are identical.  If so, then figure
out which one will do what it should be doing properly and find a way to
use that one exclusively and make the other one invisible at compile time
(basically try to use one or the other).

Let me know how it goes...and hope that long explanation helped...

C


Reply to: