After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 162569 - newer versions of bdb have an argument to a function again
newer versions of bdb have an argument to a function again
Status: RESOLVED OBSOLETE
Product: libgda
Classification: Other
Component: general
1.2.x
Other Linux
: Normal normal
: ---
Assigned To: Rodrigo Moya
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-12-30 19:21 UTC by Tobias Kieslich
Modified: 2007-02-06 15:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tobias Kieslich 2004-12-30 19:21:10 UTC
You need a new version of db installed. Here it is 4.3.27. If you build libgda
against it it will fail, due to a "too few arguments" error:

gda-bdb-recordset.c: In function `gda_bdb_recordset_new':
gda-bdb-recordset.c:234: warning: passing arg 2 of pointer to function from
incompatible pointer type
gda-bdb-recordset.c:234: error: too few arguments to function
make[2]: *** [gda-bdb-recordset.lo] Error 1

I don't know in which version excatly of bdb this has been reintroduced again.
extending line #231 like this
#if BDB_VERSION < 40000 || BDB_VERSION > 40300
worked for me.

PS: is there a component for bdb, and what is the name - so far filed under general
Comment 1 Mike Castle 2004-12-31 02:43:17 UTC
I'm not sure that's the correct fix.  That #if covers the 3rd argument, but the
new transaction parameter is the 2nd argument.

A better fix might be something like this:

       /* get the number of records in the database */
       ret = dbp->stat (dbp,
#if BDB_VERSION > 40300
                        NULL,
#endif
                        &statp,
#if BDB_VERSION < 40000
                        NULL,
#endif


More info here:

http://www.sleepycat.com/docs/ref/upgrade.4.3/stat.html


The diff for DB between 4.2.52 and 4.3.21 is:
-       int  (*stat) __P((DB *, void *, u_int32_t));
+       int  (*stat) __P((DB *, DB_TXN *, void *, u_int32_t));
+       int  (*stat_print) __P((DB *, u_int32_t));

The diff for DB between ... strange... it's the same... 

Ahh... looks like the signature changed between 3.2.9 and 3.3.11:
-       int  (*set_realloc) __P((DB *, void *(*)(void *, size_t)));
-       int  (*stat) __P((DB *, void *, void *(*)(size_t), u_int32_t));
+       int  (*stat) __P((DB *, void *, u_int32_t));
Comment 2 Tobias Kieslich 2004-12-31 12:24:39 UTC
I'm too stupid to count up to three ;)
Your fix should handle that correctly, at least according to the type and number
of arguments that DB->stat expects.

Form the specs:
If the operation is to be transaction-protected, the txnid parameter is a
transaction handle returned from DB_ENV->txn_begin; otherwise, NULL.
Comment 3 Murray Cumming 2006-12-27 18:36:36 UTC
It would be nice if someone could attach a patch.
Comment 4 Murray Cumming 2007-01-23 18:39:12 UTC
Is this a duplicate of bug #370349?
Comment 5 Murray Cumming 2007-02-06 15:57:03 UTC
Please reopen if this is still a problem in the latest versions.