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

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

Thanks for the follow up Howard. I'm busy cranking out a number of
dependent packages to compile some software, OpenLDAP being one of
many. We have an aversion to the use of GCC here so situations like
this compilation fail are somewhat common. It's nice though when code
is kept simple and portable as it makes life easier.

I don't normally spend much time debugging code and shipping fixes in
a nice box with a pretty bow on it, I've just cut and pasted the two
lines I used to allow compilation, part of the compile recipe used to
crank out this 2.4.33 release.
Hopefully that's enough to update your git archives.


On Wed, Feb 20, 2013 at 3:20 PM, Howard Chu <hyc@symas.com> wrote:
> mark@ibiblio.org wrote:
>> Full_Name: Mark
>> Version: 2.4.33
>> OS: Solaris 10 & 11
>> URL: ftp://ftp.openldap.org/incoming/
>> Submission from: (NULL) (
>> 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/