Donate Share

CLISP - an ANSI Common Lisp

Tracker: Bugs

5 Compilation fails against db 4.5.20 - ID: 1612358
Last Update: Settings changed ( sds )

Compilation of 2.41 fails against berkeley db version 4.5.20 with the
following error:
In file included from bdb.c:8:
../clisp.h:681: warning: register used for two global register variables
bdb.c:2563: error: ‘DB_LOCK_DIRTY’ undeclared here (not in a function)
bdb.c: In function ‘C_subr_bdb_dbe_get_options’:
bdb.c:962: warning: implicit declaration of function
‘dbe_get_tas_spins’
bdb.c:962: warning: assignment makes pointer from integer without a cast
bdb.c:1069: warning: assignment makes pointer from integer without a cast

The macro DB_LOCK_DIRTY is not defined anymore in db 4.5.20. What I don't
understand however, is that since bdb.m.c is generated from bdb.c, the code
for DB_LOCK_DIRTY is generated at all! Throughout the whole source of clisp
I couldn't find this symbol, neither did I in the include files for db.


Gerard Milmeister ( gemi ) - 2006-12-09 22:11

5

Closed

Fixed

Sam Steingold

modules

build problems

Public


Comments ( 5 )

Date: 2008-01-24 04:59
Sender: sdsProject AdminAccepting Donations


thank you for your bug report.
the bug has been fixed in the CVS tree.
you can either wait for the next release (recommended)
or check out the current CVS tree (see http://clisp.cons.org)
and build CLISP from the sources (be advised that between
releases the CVS tree is very unstable and may not even build
on your platform).


Date: 2007-01-02 17:15
Sender: sdsProject AdminAccepting Donations


specifically,
DEFCHECKER(check_lockmode, enum=db_lockmode_t, prefix=DB_LOCK, default=,
\
NG READ WRITE WAIT IWRITE IREAD IWR DIRTY WWRITE)
is transformed into
...
static const c_lisp_pair_t check_lockmode_table[] = {
{ DB_LOCK_NG, &(O(object_Kng)) },
{ DB_LOCK_READ, &(O(object_Kread)) },
{ DB_LOCK_WRITE, &(O(object_Kwrite)) },
{ DB_LOCK_WAIT, &(O(object_Kwait)) },
{ DB_LOCK_IWRITE, &(O(object_Kiwrite)) },
{ DB_LOCK_IREAD, &(O(object_Kiread)) },
{ DB_LOCK_IWR, &(O(object_Kiwr)) },
{ DB_LOCK_DIRTY, &(O(object_Kdirty)) },
{ DB_LOCK_WWRITE, &(O(object_Kwwrite)) },
{ 0, NULL }
};
...
normally, an ifdef would guard each line like this:
...
#ifdef DB_NEXT
{ DB_NEXT, &(O(object_Knext)) },
#endif
...
but in this particular case the constants DB_LOCK_* are not #defined,
they are enumerated in /usr/include/db4/db.h:
...
/*
* Simple R/W lock modes and for multi-granularity intention locking.
*
* !!!
* These values are NOT random, as they are used as an index into the
lock
* conflicts arrays, i.e., DB_LOCK_IWRITE must be == 3, and DB_LOCK_IREAD
* must be == 4.
*/
typedef enum {
DB_LOCK_NG=0, /* Not granted. */
DB_LOCK_READ=1, /* Shared/read. */
DB_LOCK_WRITE=2, /* Exclusive/write. */
DB_LOCK_WAIT=3, /* Wait for event */
DB_LOCK_IWRITE=4, /* Intent exclusive/write. */
DB_LOCK_IREAD=5, /* Intent to share/read. */
DB_LOCK_IWR=6, /* Intent to read and write. */
DB_LOCK_DIRTY=7, /* Dirty Read. */
DB_LOCK_WWRITE=8 /* Was Written. */
} db_lockmode_t;
...
so there is no way (except for a configure trick) to find out if a
specific constant is present.
Normally, developers would do something like (/usr/include/sys/socket.h):
...
/* The following constants should be used for the second parameter of
`shutdown'. */
enum
{
SHUT_RD = 0, /* No more receptions. */
#define SHUT_RD SHUT_RD
SHUT_WR, /* No more transmissions. */
#define SHUT_WR SHUT_WR
SHUT_RDWR /* No more receptions or transmissions. */
#define SHUT_RDWR SHUT_RDWR
};
...
my previous requests to the Berkeley DB developers to make db more
"versioning-friendly" were met with an unbelievable reply that I am
supposed to bundle a specific version of db with my program.



Date: 2006-12-10 16:51
Sender: sdsProject AdminAccepting Donations


see berkeley-db/Makefile which should point you to modprep
http://clisp.cons.org/impnotes/modules.html#modprep


Date: 2006-12-10 01:06
Sender: gemi


Well that's obvious :-)
What I would like to know, however, is: How is bdb.m.c generated, and
where do these symbols come from, if they are nowhere found in the source
code?


Date: 2006-12-10 00:02
Sender: sdsProject AdminAccepting Donations


4.5 is not supported (yet).
see http://clisp.cons.org/impnotes/berkeley-db.html for the list of
supported versions.


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2008-01-24 04:59 sds
resolution_id None 2008-01-24 04:59 sds
assigned_to haible 2008-01-24 04:59 sds
close_date - 2008-01-24 04:59 sds