Version mismatched refdbd.c and .h in HEAD (was Build error)

David Nebauer <[email protected]>
Newsgroups gmane.text.refdb.general,gmane.text.refdb.devel
Message-ID <[email protected]>
David Nebauer wrote:

> Markus Hoenicka wrote:
>
>> David Nebauer writes:
>> > I've just attempted to build refdb from cvs (cvs checked out less 
>> than 5 > minutes ago) and got the following build-time error:
>> > refdbd.c: In function `main':
>> > refdbd.c:1226: error: too many arguments to function `createdb'
>>
>> This means there's a mismatch between the createdb() prototype in
>> refdbd.h and the implementation in refdbd.c. To the best of my
>> knowledge, this does not reflect the status in either the stable
>> branch or in HEAD. Make sure the files are up to date.
>> <snip>
>> If "branch mixing" is the cause of this problem, then doing a fresh
>> checkout should solve it. 
>

Okay, I've done some more investigating, this time using the sources 
from sf <http://cvs.sourceforge.net/viewcvs.py/refdb/refdb/>.  I've 
looked at the versions for refdbd.c and refdbd.h.in from HEAD 
<http://cvs.sourceforge.net/viewcvs.py/refdb/refdb/src/?only_with_tag=HEAD>, 
MAIN 
<http://cvs.sourceforge.net/viewcvs.py/refdb/refdb/src/?only_with_tag=MAIN> 
and 0_9_5_stable 
<http://cvs.sourceforge.net/viewcvs.py/refdb/refdb/src/?only_with_tag=Release_0_9_5_stable>.

The respective versions are:
                refdbd.c     refdbd.h.in
HEAD              1.75            1.7
MAIN              1.75            1.7
0_9_5_stable      1.74            1.7

So, for MAIN, HEAD and 0_9_5_stable the createdb prototype in 
refdbd.h.in (v. 1.7) is:
int createdb(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname, 
const char* db_encoding)          ==> 3 parameters

The createdb invocation in 0_9_5_stable in refdbd.c (v. 1.74) is:
createdb(ptr_child_clrequest, ptr_child_clrequest->inargv[optind], 
db_encoding)                          ==> 3 parameters

The createdb invocation in MAIN and HEAD in refdbd.c (v. 1.75) is:
createdb(ptr_child_clrequest, ptr_child_clrequest->inargv[optind], 
db_encoding, ref_format)              ==> 4 parameters

I'm no expert at C/C++, but it seems apparent there is a parameter 
mismatch between refdbd.c (v. 1.75) and refdbd.h.in (v. 1.7) as far as 
createdb() is concerned.  That is, anyone checking out from MAIN or HEAD 
will get refdbd.c (v. 1.75) which will not compile with refdbd.h.in (v. 
1.7).

I know very little about CVS, but I gather MAIN and HEAD both refer to 
the latest version.  From what I read it also appears HEAD is the 
default version checked out when no revision is specified.  So, when I 
use the CVS command given in the manual (cvs -d 
:pserver:[email protected]:/cvsroot/refdb -z3 checkout 
refdb) I'm actually checking out the HEAD branch.

As shown above, that branch has incompatible versions of refdbd.c and 
refdbd.h.in and will not build.  That has certainly been my experience 
for several weeks now.

My conclusion, then, is that the HEAD branch in CVS must be corrected to 
contain compatible versions of refdbd.c and refdbd.h.in.  If my 
reasoning is flawed I'd appreciate someone pointing it out.  Otherwise, 
can any of the developers correct the sf repository?

Regards,
David.



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the
one installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.