[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Compile problem



I'm currently trying to compile Apple WebObjects Adaptor for Apache on my debian PPC.

The problem is that the compile time doesn't ends happily as it is made for Solaris and HP-UX.
After a frew changes (2-3 modfied lines of code), I fail on the last error. Here it is :

cc -O2 -Wall -I../Adaptor  -DSINGLE_THREADED_ADAPTOR -DSOLARIS -DFORKING_WEBSERVER -DAPACHE -c ../Adaptor/wastring.c
../Adaptor/wastring.c: In function `str_vappendf':
../Adaptor/wastring.c:199: invalid initializer

I look at the code and see :

int str_vappendf(String *s, const char *format, va_list args)
{
   int i, len, requiredBufferSize;
   va_list sizer = args;        <-- here is the line 199

   /* figure out how much space we will need */
   len=1; /* start len at 1 to include the terminator */

To check i tried to compile this code :

#include <stdarg.h>
int main (void)
{
        va_list mytab ;
        va_list mysecondtab ;
        mysecondtab = mytab;
}

and get :

gcc -o testassign test.c
test.c: In function `main':
test.c:7: incompatible types in assignment

After a few checkings it seems that va_list is declared in stdarg.h is defined as _gnuc_va_list, which in turn is defined as void *. The problem is that is I run this small program :

#include <stdarg.h>
#include <stdio.h>
int main (void)
{
        printf ("size of va_list : %d", sizeof (va_list));
}

I get :

size of va_list : 12

So I have two questions :

Is va_list a real void * pointer, and if so why is it 12 bytes long?
If not what is it so that gcc can't make by default a copy of it?

Thank you

Damien GUIHAL
Nantes France

P.S. I know about the -DSOLARIS flag in the compilation line, but i think it's the closest architecture available (HP/UX, SOLARIS, WINNT, MOSXS)

Attachment: pgpUfOpp2yNby.pgp
Description: PGP signature


Reply to: