>Number:         677
>Category:       other
>Synopsis:       Having trouble with compilation of C++ code using some headers.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apache (Apache HTTP Project)
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Jun  4 14:40:01 1997
>Originator:     [EMAIL PROTECTED]
>Organization:
apache
>Release:        1.2b11
>Environment:
I am using the gcc 2.7.2 compiler with SOLARIS 2.5.  I am also running into 
this problem using
the gcc compiler on Linux 2.0 from Redhat.

Solaris uname info:
SunOS aruba.webengine-db.com 5.5 Generic sun4m sparc SUNW,SPARCstation-LX
>Description:
My C++ code will not compile on Solaris or Linux with the GNU GCC 2.7.2 
compiler.

The problem seems to be with the pool declarations that are within a struct.

For example the following will compile:

typedef struct {
    struct pool *pool;
    int elt_size;
    int nelts;
    int nalloc;
    char *elts;
} array_header;

but as it is declared in alloc.h will not (notice the struct declaration in 
from of pool):

typedef struct {
    pool *pool;
    int elt_size;
    int nelts;
    int nalloc;
    char *elts;
} array_header;

When I added the struct declaration to all headers that refer to pool within a 
struct
everything compiled fine and it seemed to have no adverse effect on the normal 
build of the server in C.
>How-To-Repeat:
Try compiling using a source file that ends with .cpp instead of .c
>Fix:
See description of problem above for how I fixed it on my system.  This had to
be added to all header files which declared pool within a struct.
alloc.h, httpd.h http_config.h and buff.
>Audit-Trail:
>Unformatted:


Reply via email to