Operating System - HP-UX
1754014 Members
7286 Online
108811 Solutions
New Discussion юеВ

Re: io_search_array giving error as: error #2140: too many arguments in function call

 
shivarajbm
Occasional Contributor

io_search_array giving error as : error #2140: too many arguments in function call

I am trying to use io_search_array to get the token to search for I/O subsystem in my HP-UX server. Using this token I would like to use io_query_batch and other related API's to fetch disk related information. But I am getting "error #2140: too many arguments in function call" error message when I tried to compile the code.

 

Note: The same io_search_array line is working from a different program on same HP-UX 11.31 box. Not sure why I am getting this error when I try this from a sample code. Could you please help in identifying the problem to fix this issue?

 

Here is the sample code :

sample1.cpp

 

#include <string.h>

#include<sys/libIO.h>
int main()

int         qual=0; 

void        *ptr_arr[2];

char        *key_arr[2];

io_token_t  token = NULL;

token = io_search_array( token, S_IOTREE_EXT, qual, key_arr, ptr_arr );

}

 

3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: io_search_array giving error as: error #2140: too many arguments in function call

Compile with these extra options: -E -.i

Take a look at the line in the .i file and see if some evil macro messed up the call or declaration.

shivarajbm
Occasional Contributor

Re: io_search_array giving error as: error #2140: too many arguments in function call

Hmm... Tried this but still no luck.

I could not find any special chars or macro messing up function declaration. Any other hints or any other sample codes?

Regards,

Shivaraj

Dennis Handly
Acclaimed Contributor

Re: io_search_array giving error as: error #2140: too many arguments in function call

>Tried this but still no luck.

 

Did you look closely at the .i file?  ;-)

 

You can't use <sys/libIO.h> with C++.  That header isn't C++ified.

I suppose you could lie and compile with -D__STDC__.