Project

General

Profile

[Solved] Lighttpd 1.4.60 make error typedef fdlog_st redefinition

Added by Agossi over 2 years ago

Cannot make the latest 1.4.60 lighttp.

used the following configure cmd:

./configure --with-openssl \
    --without-libev \
    --without-mysql \
    --without-pgsql \
    --without-dbi \
    --without-sasl \
    --without-ldap \
    --without-pam \
    --without-wolfssl \
    --host=arm-none-linux-gnueabi CC=arm-linux-gnueabi-gcc  RANLIB=arm-linux-gnueabi-ranlib STRIP=arm-linux-gnueabi-strip \
    CFLAGS='-std=c99'

followd by make results in:

In file included from t/test_configfile.c:9:
./fdlog.h:13: error: redefinition of typedef ‘fdlog_st’
./base_decls.h:28: note: previous declaration of ‘fdlog_st’ was here
make3: * [Makefile:2616: t/test_configfile.o] Error 1
make2:
[Makefile:1963: all] Error 2
make1:
[Makefile:470: all-recursive] Error 1
make: *
[Makefile:400: all] Error 2

Lighttpd 1.4.59 worked also the CFLAGS='-std=c99' was not necessary at all.

Please advise how to get it compiled.


Replies (2)

RE: Lighttpd 1.4.60 make error typedef fdlog_st redefinition - Added by Agossi over 2 years ago

fixed it by adding own header for inclusion my compiler does not allow c11 standard using typedef redefinitions, so this was at least a solution.

#ifndef INCLUDED_HELPER_H
#define INCLUDED_HELPER_H
#include "buffer.h" 

typedef struct fdlog_st {
    enum { FDLOG_FILE, FDLOG_FD, FDLOG_SYSLOG, FDLOG_PIPE } mode;
    int fd;
    buffer b;
    const char *fn;
} fdlog_st;

#ifndef log_error_st
    typedef struct fdlog_st log_error_st;
#endif 

#endif

RE: Lighttpd 1.4.60 make error typedef fdlog_st redefinition - Added by gstrauss over 2 years ago

It looks to me as if the (ancient) compiler did not like the repeated typedef, and there is a much simpler solution.

--- a/src/fdlog.h
+++ b/src/fdlog.h
@@ -5,12 +5,12 @@
 #include "base_decls.h" 
 #include "buffer.h" 

-typedef struct fdlog_st {
+struct fdlog_st {
     enum { FDLOG_FILE, FDLOG_FD, FDLOG_SYSLOG, FDLOG_PIPE } mode;
     int fd;
     buffer b;
     const char *fn;
-} fdlog_st;
+};

 __attribute_cold__
 __attribute_returns_nonnull__

    (1-2/2)