Operating System - HP-UX
1751976 Members
5069 Online
108784 Solutions
New Discussion юеВ

Error while compilation in HP-UX11.i

 
SOLVED
Go to solution
Anand_30
Regular Advisor

Error while compilation in HP-UX11.i

Hi,

I am compiling some C code in HP-UX11.i. I am getting the following error:

vatxdr_svc.c:81: warning: assignment makes pointer from integer without a cast

for the code:

transp = svctcp_create(sock, 0, 0);
transpHandle = transp;

Can anyone please help me out in this problem.

Thanks,
Andy

6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Error while compilation in HP-UX11.i

Firstly, the use of svctcp_create is discouraged because it it considered obsolete. Man rpc_svc_create for the replacement functions. To fix your current problem, you need to declare transp like this:

SVCXPRT *transp;
I assume you are already including rpc.h.

If it ain't broke, I can fix that.
Umapathy S
Honored Contributor

Re: Error while compilation in HP-UX11.i

Anand,
svctcp_create returns a pointer to SVCXPRT.

What is the data type of transp and transpHandle. There is the problem.

HTH,
Umapathy
Arise Awake and Stop NOT till the goal is Reached!
Anand_30
Regular Advisor

Re: Error while compilation in HP-UX11.i

Hi,

In my code transp is already declared as

SVCXPRT *transp;

and transpHandle is declared as

SVCXPRT *transpHandle;

But still I am getting the warning.

Thanks,
Andy



Anand_30
Regular Advisor

Re: Error while compilation in HP-UX11.i

Hi,

I am able to compile this code successfully in HP-UX10.20 but in HP-UX11.i, I am getting this warning message.

Thanks,
Andy
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Error while compilation in HP-UX11.i

You problem is that svctcp_create is undeclared and thus is implicitly an function returning an int. Add #include after the rpc.h include.
If it ain't broke, I can fix that.
Anand_30
Regular Advisor

Re: Error while compilation in HP-UX11.i

Now it's working.

Thanks a lot