Operating System - HP-UX
1834745 Members
3009 Online
110070 Solutions
New Discussion

gethostbyname failed compiling with 64bit mode

 
阿江 孝士
New Member

gethostbyname failed compiling with 64bit mode

Hi.(I'm sorry, I can't write english well.)

I try to port 32bit C application
to 64bit C application.

My environment.
OS: "HP-UX eai-psv2 B.11.23 U ia64".
compiler: "cc: HP C/aC++ B3910B A.06.17"

When compiling with 32bit mode,
gethostbyname () normal end.
But compiling with 64bit mode(+DD64),
gethostbyname () failed.


When calling gethostbyname () from mini program,
compiling 64bit mode,it end normal.


Please tell me how to recover.

Thanks.
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: gethostbyname failed compiling with 64bit mode

>But compiling with 64bit mode (+DD64), gethostbyname failed.
>When calling gethostbyname from mini program,
compiling 64bit mode, it end normal.

You need to compile with +wlint and +w64bit and fix any warnings.

Some of the networking length parms are changed to pointers to 64 bit integers. Also look for casts to suppress any warnings in this area. This would hide the problems.
阿江 孝士
New Member

Re: gethostbyname failed compiling with 64bit mode

>You need to compile with +wlint and +w64bit and fix any warnings.
>
>Some of the networking length parms are changed to pointers to 64 bit
>integers. Also look for casts to suppress any warnings in this
>area. This would hide the problems.

Thanks.
I will try with above option, and fixed warnings.

If you know, please tell me...

Excepting lint, Is there any tools which check above patternï¼
"HP STK tools" can check thems?

Thanks
阿江 孝士
New Member

Re: gethostbyname failed compiling with 64bit mode

>>You need to compile with +wlint and +w64bit and fix any warnings.
>>
>>Some of the networking length parms are changed to pointers to 64 bit
>>integers. Also look for casts to suppress any warnings in this
>>area. This would hide the problems.
>
>Thanks.
>I will try with above option, and fixed warnings.
>
>If you know, please tell me...
>
>Excepting lint, Is there any tools which check above patterni??
>"HP STK tools" can check thems?

I'm sorry, STK site is here.

http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=965fe820bcd45110VgnVCM100000275d6e10RCRD


>
>Thanks


Dennis Handly
Acclaimed Contributor

Re: gethostbyname failed compiling with 64bit mode

>Excepting lint, Is there any tools which check above pattern

There is no lint on IPF, only +wlint, which is much better.

If you know which call to gethostbyname is bad, you should look very closely at it. Can you provide a small snip of the call? And the types of all of the parms.