Bug #289

g++ problem

Added by Anonymous 1199 days ago. Updated 89 days ago.

Status:Wontfix Start:
Priority:Normal Due date:
Assigned to:- % Done:

0%

Category:core
Target version:-
Pending:

No

Resolution:

wontfix

Patch available:


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

diff.txt - Diff of base.h -- kimata (1.2 KB) Anonymous, 09/30/2005 08:53 AM

rename_type_to_type_t.diff - -- Aaron Walker <ka0ttic (6.5 KB) Anonymous, 09/30/2005 02:27 PM

History

09/29/2005 11:02 PM - Anonymous

  • 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

09/30/2005 12:12 AM - jan

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.

09/30/2005 12:35 AM - Anonymous

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

-- kimata

09/30/2005 08:20 AM - jan

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++.

09/30/2005 09:13 AM - Anonymous

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

10/09/2005 06:12 PM - Anonymous

Nice! It seems to work well.

-- kimata

12/26/2006 03:30 PM - Anonymous

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

08/31/2008 11:12 PM - stbuehler

  • Status changed from Need Feedback to Fixed
  • Resolution set to wontfix

10/10/2008 07:03 PM - stbuehler

  • Status changed from Fixed to Wontfix

Also available in: Atom PDF