[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#7529) mdb.c missing #if MDB_DEBUG at line 3514



mark@ibiblio.org wrote:
> Full_Name: Mark
> Version: 2.4.33
> OS: Solaris 10 & 11
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (203.63.89.15)
>
>
> The stock 2.4.33 fails to compile mdb with this error:
>
>   cc -I/usr/local/include -L/usr/local/lib -I../../../include -I../../../include
> -I.. -I./.. -I./../../../libraries/libmdb -I/usr/local/include -L/usr/local/lib
> -c ./../../../libraries/libmdb/mdb.c -o mdb.o
> "./../../../libraries/libmdb/mdb.c", line 3514: undefined symbol: top
> "./../../../libraries/libmdb/mdb.c", line 3514: left operand of "->" must be
> pointer to struct/union
> cc: acomp failed for ./../../../libraries/libmdb/mdb.c
>
> The problem is top is defined inside #if MDB_DEBUG but used without the same #if
> qualifier.

Normally the DPRINTF macro would just expand to ((void) 0) if MDB_DEBUG is not 
defined, so no, top is not being used without MDB_DEBUG. But looking closer, I 
see this requires a C preprocessor that supports vararg macros. Don't you have 
a C99-compatible toolchain on Solaris?

> The fix is:
>      /bin/perl -pe '($. == 3514) && s%^%#if MDB_DEBUG\n%' -i
> libraries/libmdb/mdb.c
>      /bin/perl -pe '($. == 3517) && s%^%#endif\n%' -i libraries/libmdb/mdb.c

In the future, please use unified diff format. Preferably just use "git 
format-patch" like it says on http://www.openldap.org/devel/contributing.html

We don't make changes in already released code, and line numbers alone are a 
poor reference in development code.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/