Bug 940

Summary: xmmap.c noequality compile error on Digital UNIX 4.0F PK7
Product: Portable OpenSSH Reporter: Andrea <anenni>
Component: Build systemAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: critical CC: mcaskill.scott
Priority: P2    
Version: 3.9p1   
Hardware: Alpha   
OS: OSF/1   

Description Andrea 2004-10-06 04:20:03 AEST
On Digital UNIX 4.0F (patch-kit 7), after configure with only zlib path, make
command fails with this error:

root@plutone/var/appoggio/openssh-3.9p1# make
(cd openbsd-compat && make)
cc -std1 -g -I. -I.. -I. -I./.. -I/usr/local/ssl/include -I/usr/local/include 
-DHAVE_CONFIG_H -c xmmap.c
cc: Error: xmmap.c, line 50: In this statement, "address" and "(-1)" cannot be
compared for equality or inequality. (noequality)
        if (address == MAP_FAILED) {
------------^
*** Exit 1
Stop.
*** Exit 1
Stop.

Openssh 3.8.1p1 compiles fine giving just this warning:

cc -g -I. -I.. -I. -I./.. -I/usr/local/ssl/include -I/usr/local/include 
-DHAVE_CONFIG_H -c xmmap.c
cc: Warning: xmmap.c, line 50: In this statement, "(-1)" of type "long", is
being converted to "pointer to void". (cvtdiftypes)
        if (address == MAP_FAILED) {
------------^
Comment 1 Darren Tucker 2004-10-06 08:21:31 AEST
I can't see why that would fail in 3.9p1 and work in 3.8.1p1 since xmmap.c has
changed only minimally and that chunk of code hasn't changed at all.

Can you try casting the constant to void *, ie change:
if (address == MAP_FAILED) {
to:
if (address == (void *)MAP_FAILED) {
Comment 2 Darren Tucker 2004-10-06 21:47:14 AEST
*** Bug 929 has been marked as a duplicate of this bug. ***
Comment 3 Andrea 2004-10-06 22:24:58 AEST
With the change you suggested xmmap.c compiles with no warning at all.

Making all gives the same error with monitor_mm.c

cc -std1 -g -I. -I. -I/usr/local/ssl/include -I/usr/local/include 
-DSSHDIR=\"/usr/local/etc\"  -D_PATH_SSH_PROGRAM=\"/usr/local/bin/ssh\" 
-D_PATH_SSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh-askpass\" 
-D_PATH_SFTP_SERVER=\"/usr/local/libexec/sftp-server\" 
-D_PATH_SSH_KEY_SIGN=\"/usr/local/libexec/ssh-keysign\" 
-D_PATH_SSH_PIDDIR=\"/var/run\"  -D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" 
-DSSH_RAND_HELPER=\"/usr/local/libexec/ssh-rand-helper\" -DHAVE_CONFIG_H -c
monitor_mm.c
cc: Error: monitor_mm.c, line 95: In this statement, "address" and "(-1)" cannot
be compared for equality or inequality. (noequality)
        if (address == MAP_FAILED)
------------^
*** Exit 1
Stop.

I made the same change and now it compiles.
I cannot do "make install" and complete tests now but the new compiled ssh
client seems to work just fine.

Comment 4 Andrea 2004-10-06 22:32:24 AEST
Did you note in the logs that Openssh 3.8.1p1 compilation has no -std1 option?
Probably that's the real cause.
Comment 5 Darren Tucker 2004-10-06 23:16:38 AEST
I didn't notice that and you're probably right, that would explain it.  It's
probably due to the newer version of autoconf used for 3.9p1 (2.59 vs 2.52).

Anyway, both changes applied, thanks for the report.
Comment 6 Darren Tucker 2006-10-07 11:37:28 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.