Operating System - HP-UX
1825011 Members
4748 Online
109678 Solutions
New Discussion юеВ

Invalid parameter list declaration

 
Nick Gamroth
New Member

Invalid parameter list declaration

I'm trying to compile a package called VRPN (http://www.cs.unc.edu/Research/vrpn/index.html) under hpux 11. I keep getting invalid parameter list declaration errors. I'm compiling with:
CFLAGS = -Ae -I/opt/CC/include/CC/ -lvrpn -lvrpnserver

myserver:myserver.o
$(CC) $(LDFLAGS) -o myserver myserver.o
myserver.o:myserver.c
$(CC) $(CFLAGS) -c myserver.c

and one of my function declarations looks like:

extern int vrpn_unbuffer (const char ** buffer, vrpn_int16 * lval);

the function is:

int vrpn_buffer (char ** insertPt, vrpn_int32 * buflen, const vrpn_uint16 value)
{
vrpn_uint16 netValue = htons(value);
int length = sizeof(netValue);

if (length > *buflen) {
fprintf(stderr, "vrpn_buffer: buffer not large enough\n");
return -1;
}

memcpy(*insertPt, &netValue, length);
*insertPt += length;
*buflen -= length;

return 0;
}

any ideas for me? from other things i've seen, i need to compile with ansi c, so i put in the -Ae and tried -Aa, but i still get the same results.

Let the foxy boxing begin.
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Invalid parameter list declaration

Hi Nick:

I guessing because of an incorrect #define in one of your header/include files, that those vrpnxxxx types aren't known.

If somewhere above the functions with the problems you make a file scope variable declaration, you can confirm this. e.g.

static vrpn_int16 my_dummy_var;

If that declaration fails, then the vrpn_int16 type is not defined.

Regards, Clay
If it ain't broke, I can fix that.
Nick Gamroth
New Member

Re: Invalid parameter list declaration

Hi Clay,

Ok, I tried putting these two lines in:

static vrpn_int16 dummy_16;
static vrpn_int32 dummy_32;

and the errors didn't change. There were no errors indicated on either of those lines. Actually... I just noticed that it doesn't error on this declaration:

extern int vrpn_buffer (char ** insertPt, vrpn_int32 * buflen,
const vrpn_int8 value);

but it does on this one which is on the next line:

extern int vrpn_buffer (int ** insertPt, vrpn_int32 * buflen,
const vrpn_int16 value);

I read through the other declarations, and it only errors on lines that don't have vrpn_int8 in the parameter list...
Let the foxy boxing begin.
A. Clay Stephenson
Acclaimed Contributor

Re: Invalid parameter list declaration

Okay Nick, that helps a bit. My best guess is that these functions have already been declared in a header file and that the declarations in this source file don't match what it has already seen. If I have a bit of spare time, I may download this and see if I can duplicate your error. This is fairly typical of ports and it usually winds up being simple simple but not always obvious. I assume that you download any other packages that were listed as dependencies.

If it ain't broke, I can fix that.
Nick Gamroth
New Member

Re: Invalid parameter list declaration

I don't know if this will help, but this is the definitions of all the vrpn types...

typedef char vrpn_int8;
typedef unsigned char vrpn_uint8;
typedef short vrpn_int16;
typedef unsigned short vrpn_uint16;
typedef int vrpn_int32;
typedef unsigned int vrpn_uint32;
typedef float vrpn_float32;
typedef double vrpn_float64;

Let the foxy boxing begin.
A. Clay Stephenson
Acclaimed Contributor

Re: Invalid parameter list declaration

Hi Nick:

I downloaded the source and decided that this was "too much sugar for a dime". I'm certain that you are going to have to set the defines for HP-UX properly but I just don't have the time to hunt this one down.

Regards, Clay
If it ain't broke, I can fix that.