Project

General

Profile

Actions

Bug #289

closed

g++ problem

Added by Anonymous over 19 years ago. Updated over 16 years ago.

Status:
Wontfix
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:

Description

if fdevent.h is included from C++ source file, GCC complains the following message.


/tmp/lighttpd-1.3.16/src/fdevent.h:132: error: declaration of `fdlist
   fdevents::fdlist'
/tmp/lighttpd-1.3.16/src/fdevent.h:116: error: changes meaning of `
   fdlist' from `typedef struct fdlist fdlist'

(This problem is GCC specific. See http://gcc.gnu.org/ml/gcc/2003-04/msg00691.html)

Could you chage declaration of fdlist like below?


typedef struct {
    fdnode *first, *last;
} fdlist_t;

-- kimata


Files

diff.txt (1.18 KB) diff.txt Diff of base.h -- kimata Anonymous, 2005-09-30 08:53
rename_type_to_type_t.diff (6.47 KB) rename_type_to_type_t.diff -- Aaron Walker <ka0ttic Anonymous, 2005-09-30 14:27
Actions #1

Updated by Anonymous over 19 years ago

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (fixed)

Thanks.

But, the same problem still exists.


/tmp/lighttpd-1.4.4/src/base.h:350: error: declaration of `request
   <anonymous struct>::request'
/tmp/lighttpd-1.4.4/src/base.h:166: error: changes meaning of `request'
   from `typedef struct request request'
/tmp/lighttpd-1.4.4/src/base.h:352: error: declaration of `physical
   <anonymous struct>::physical'
/tmp/lighttpd-1.4.4/src/base.h:195: error: changes meaning of `physical
   ' from `typedef struct physical physical'
/tmp/lighttpd-1.4.4/src/base.h:353: error: declaration of `response
   <anonymous struct>::response'
/tmp/lighttpd-1.4.4/src/base.h:177: error: changes meaning of `response
   ' from `typedef struct response response'
/tmp/lighttpd-1.4.4/src/base.h:551: error: declaration of `
   stat_cache*<anonymous struct>::stat_cache'
/tmp/lighttpd-1.4.4/src/base.h:223: error: changes meaning of `
   stat_cache' from `typedef struct stat_cache stat_cache'

-- kimata

Actions #2

Updated by jan over 19 years ago

Wait, why are you using a C++ compiler to compile lighttpd ?

The header files are not even announcing C naming conventions, it won't link later anyway.

Actions #3

Updated by Anonymous over 19 years ago

Because I'm writing a plug in for lighttpd in C++.

-- kimata

Actions #4

Updated by jan over 19 years ago

In that case we have to cover the header files in

#ifdef __cplusplus
extern "C" {
#endif

...

#ifdef __cplusplus
}
#endif

Check if that is enough to calm down g++.

Actions #5

Updated by Anonymous over 19 years ago

This problem is discussed in the GCC Mailing List.

http://gcc.gnu.org/ml/gcc/2003-04/msg00689.html
Another solution
would be to say g++ to treat a part of the program as pure C, this I haven't
found neither. Putting the includes within an extern "C" clause doesn't help,
and the doc doesn't mention a command-line option that would make g++ more
permissive with the code.

-- kimata

Actions #6

Updated by Anonymous over 19 years ago

Nice! It seems to work well.

-- kimata

Actions #7

Updated by Anonymous over 18 years ago

Will this patch be applied to the distribution source? I checked 1.4.13 and trunk and didn't find it applied.

I too want to develop a C++ plug in and I'm having the same problem.

-- André Cruz

Actions #8

Updated by stbuehler over 16 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to wontfix
Actions #9

Updated by stbuehler over 16 years ago

  • Status changed from Fixed to Wontfix
Actions

Also available in: Atom