Bug #289
g++ problem
| 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
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 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
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