problem building openssh-4.3p2 on Fedora Core 5 using gcc -std=c99

gnwiii at gmail.com gnwiii at gmail.com
Tue Aug 22 02:14:16 EST 2006


This problem actually came up with pdftex-1.40, which now uses the
openbsd-compat code.  I routinely build pdftex with c99 to reduce
reliance on old gcc extensions, in the hope that things will be more
consistent across linux and unix.  I think the problem is that the way
configure checks for strsep leaves things open for a #def'd version to
conflict with the replacement version. I'm willing to accept the view
that gcc -std=c99 shouldn't #def strsep, but a google search indicates
this is a common problem that is usually handled by #define
HAVE_STRSEP, so it seems wisest to adjust configure to deal with this
case.

[gwhite at fc5 test]$ zcat ~/Desktop/openssh-4.3p2.tar.gz | pax -r
[gwhite at fc5 test]$ cd openssh-4.3p2/
[gwhite at fc5 openssh-4.3p2]$ uname -r
2.6.17-1.2174_FC5
[gwhite at fc5 openssh-4.3p2]$ gcc --version
gcc (GCC) 4.1.1 20060525 (Red Hat 4.1.1-1)
[gwhite at fc5 openssh-4.3p2]$ CFLAGS='-std=c99 -O2' ./configure

[...]
checking whether strsep is declared... no
[...]

OpenSSH has been configured with the following options:
                     User binaries: /usr/local/bin
                   System binaries: /usr/local/sbin
               Configuration files: /usr/local/etc
                   Askpass program: /usr/local/libexec/ssh-askpass
                      Manual pages: /usr/local/man/manX
                          PID file: /var/run
  Privilege separation chroot path: /var/empty
            sshd default user PATH:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Manpage format: doc
                       PAM support: no
                 KerberosV support: no
                 Smartcard support: no
                     S/KEY support: no
              TCP Wrappers support: no
              MD5 password support: no
                   libedit support: no
       IP address in $DISPLAY hack: no
           Translate v4 in v6 hack: yes
                  BSD Auth support: no
              Random number source: OpenSSL internal ONLY

              Host: i686-pc-linux-gnu
          Compiler: gcc
    Compiler flags: -std=c99 -O2 -Wall -Wpointer-arith -Wuninitialized
-Wsign-compare -Wno-pointer-sign
Preprocessor flags:
      Linker flags:
         Libraries:   -lresolv -lcrypto -lutil -lz -lnsl  -lcrypt
[gwhite at fc5 openssh-4.3p2]$ grep -i strsep config.h
/* Define to 1 if you have the `strsep' function. */
/* #undef HAVE_STRSEP */
[gwhite at fc5 openssh-4.3p2]$ cd openbsd-compat
[gwhite at fc5 openbsd-compat]$ make strsep.o
gcc -std=c99 -O2 -Wall -Wpointer-arith -Wuninitialized -Wsign-compare
-Wno-pointer-sign  -I. -I.. -I. -I./..  -DHAVE_CONFIG_H -c strsep.c
In file included from ../includes.h:209,
                 from strsep.c:34:
../openbsd-compat/openbsd-compat.h:112: error: expected identifier or
'(' before '__extension__'
../openbsd-compat/openbsd-compat.h:112: error: expected identifier or
'(' before ')' token
In file included from ../openbsd-compat/openbsd-compat.h:181,
                 from ../includes.h:209,
                 from strsep.c:34:
../openbsd-compat/fake-rfc2553.h:130: error: redefinition of 'struct addrinfo'
strsep.c:53: error: expected identifier or '(' before '__extension__'
strsep.c:53: error: expected identifier or '(' before ')' token
make: *** [strsep.o] Error 1

Lines 111-113 of openbsd-compat/openbsd-compat.h:

#ifndef HAVE_STRSEP
char *strsep(char **stringp, const char *delim);
#endif




-- 
George N. White III <aa056 at chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia



More information about the openssh-unix-dev mailing list