#62 compile errors in version 2-1.1.1

closed-fixed
nobody
5
2006-10-18
2006-10-03
Patrick Schipper
No

I see the following errors when compiling on RedHat EL3
(Update 7):

gcc -DPROGRAM_NAME=\"mount.davfs\"
-DSYS_CONF=\"/usr/local/etc/davfs2/davfs2.conf\"
-DSYS_SECRETS=\"/usr/local/etc/davfs2/secrets\"
-DDATA_DIR=\"/usr/local/share/davfs2\" -DHAVE_CONFIG_H
-I. -I./src -Wall -g -O2 -I/usr/local/include/neon
-D_LARGEFILE64_SOURCE -DNE_LFS -c src/dav_coda2.c -o
src/dav_coda2.o
In file included from src/coda2.h:118,
from src/dav_coda2.c:43:
/usr/include/linux/time.h:9: redefinition of `struct
timespec'
/usr/include/linux/time.h:17: redefinition of `struct
timeval'
/usr/include/linux/time.h:43: redefinition of `struct
itimerspec'
make: *** [src/dav_coda2.o] Error 1

Discussion

  • Werner Baumann
    Werner Baumann
    2006-10-03

    Logged In: YES
    user_id=1260327

    Hello Patrick,

    the same error is reported by buzzdee (bug 1570103).

    The problem is well known: There must not be included any
    kernel headers.

    What I am wondering about: I tried to avaoid this by putting
    comments (/* */) around all dangerous includes in coda2.h
    and coda3.h. This works fine on my system.

    Maybe your compiler does not honour this comments?

    Please have a look at coda2.h and coda3.h: There must be a
    comment around line 78:
    /* We don't want to compile the kernel. wb */
    /* #include <linux/config.h> */

    If there are comments but the compiler does not honour them,
    you just may remove *any* lines starting with
    #include <
    or
    /*#include

    davfs2 does not need them. In this case it might be
    necessary to remove other parts that I commented out.
    Especially beginning at around line 777.

    Curious to here more about this
    Werner

     
  • Logged In: YES
    user_id=1203728

    The issue appears to be at line 118 in coda2.h and line 114
    in coda3.h. I commented them out and the compilation was clean.

    #if defined(__linux__)
    #include <linux/time.h>

    Thanks!
    Patrick

     
  • Werner Baumann
    Werner Baumann
    2006-10-18

    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=1203728

    Hello Werner,

    The compiler (gcc (GCC) 3.3.3 (SuSE Linux)) honors the
    comments just fine. The issue seems to be the included
    file, time.h, around lines 118 and 114 in coda2.h and
    coda3.h, respectively.

    Thanks!
    Patrick