I've got two replies, thanks to Frank Wortner and Arrigo Triulzi.
It turns out to be a compiler issue. Arrigo reminded me to install the latest
compiler version, which ought to be V6.4.
Right now I'm about to install this new compiler and will give it a try.
-------> Original question follows here <-----------
Hi all,
I downloaded samba-2.2.2 and tried to compile ( I prefer compiling a source
tar-ball myself, just to provide my own configuration flags, if any).
configure went smoothly ( I was wondering, why snprintf and vsnprintf are not
defined, but I learned, that these 'MACROS' are provided by the software itself
).
But then it doesn't compile:
First I used
CC="cc -std1"
The compilation stops at tdb/tdb.c with:
cc: Error: tdb/tdb.c, line 106: In this statement, "tdb->map_ptr" and "(-1)"
cannot be compared for equality or inequality. (noequality)
if (tdb->map_ptr == MAP_FAILED) {
--------------------^
gmake: *** [tdb/tdb.o] Error 1
I checked the includes and man pages, but there are no clue as to why cc is
complaining! mmap return a void * .
I then used CC="cc -std1 -D_ANSI_C_SOURCE -isoc94" as described in the man page
for cc. This aborts configure due to failing file locking ! [:-\]
CC="cc -std" complaines that the declaration of vsnprintf uses different
argument types.
After all I decided to modify the c source in question:
Here is a short description
MAP_FAILED is #def'd
#define MAP_FAILED ((void *) -1)
I modified
if (tdb->map_ptr == MAP_FAILED)
to
if (tdb->map_ptr == ((void *) -1)) {
and it works !
In my opinion MAP_FAILED gets simply replaced by the pre processor, so the
modified line is exactly the same as the original line that will be seen by the
compiler itself, since the macro MAP_FAILED gets replaced by the pre processor
before cc itself sees this line ... or I'm wrong ?
The next issue I discovered is that cc shows a warning that long long is a lang
extension but goes ahead in compiling.
Anybody out there who can give some advice ?
Received on Tue Dec 04 2001 - 13:22:53 NZDT