qcc compile error

Hi there,

Does anyone knows why there is an compile error “parse error before ‘…’”
when compiling the following function using qcc ?

The compile command is :

qcc -v -Vgcc_ntox86 -c socket.c

and the function in file:

int SockPrintf(socket,format, …)
int socket;
char *format;
{
va_list ap;
char buf[8192];

va_start(ap, format);
vsprintf(buf, format, ap);
va_end(ap);
return SockWrite(socket, buf, strlen(buf));
}

Thanks,
Sangwoon

E-mail : swchung@philtera.com http://www.philtera.com

“Sangwoon Chung” <swchung@philtera.com> wrote in message
news:8nfd3q$4dq$1@inn.qnx.com

Hi there,

Does anyone knows why there is an compile error “parse error before ‘…’”
when compiling the following function using qcc ?

The compile command is :

qcc -v -Vgcc_ntox86 -c socket.c

and the function in file:

I think it’s because you are using the old declaration style K&R.

Also make sure you include stdarg.h

int SocketPrintf ( int socket, char *format, … )

int SockPrintf(socket,format, …)
int socket;
char *format;
{
va_list ap;
char buf[8192];

va_start(ap, format);
vsprintf(buf, format, ap);
va_end(ap);
return SockWrite(socket, buf, strlen(buf));
}

Thanks,
Sangwoon

E-mail : > swchung@philtera.com > > http://www.philtera.com