- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: aCC compiler preprocessing assumes _SOCKLEN_T ...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2010 11:25 PM
09-12-2010 11:25 PM
I have written a program as below in HP-UX 11.31
Made use of aCC compilor. This defined the _SOCKLEN_T and the code within #define is compiled
----------------------------------
$ > cat checkHello1.cxx
#include
using namespace std;
int main()
{
#if defined(_SOCKLEN_T)
cout << "Inside define _SOCKLEN_T Hello " << endl;
#endif
cout << "outside define _SOCKLEN_T" << endl;
return 0;
}
-----------------------------
Compiled this program as below
$ /opt/aCC/bin/aCC -o checkHello1 checkHello1.cxx
Result I got is
$ ./checkHello1
Inside define _SOCKLEN_T Hello
outside define _SOCKLEN_T
$ uname -s -r -v
HP-UX B.11.31 U
So compilor preprocessing assumed define _SOCKLEN_T.
The same code works fine in HP-UX 11.23
Follwoing is result I got in HP-UX 11.23
$ ./checkHello1
outside define _SOCKLEN_T
$ uname -s -r -v
HP-UX B.11.23 U
Did any one faced this issues?
Is it a issue with compilor or environment?
Solved! Go to Solution.
- Tags:
- socket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2010 12:43 AM
09-13-2010 12:43 AM
Re: aCC compiler preprocessing assumes _SOCKLEN_T as defined in HP-UX 11.31
Applications should not use or depend on such symbols in any way, unless documented.
(For example, the _HPUX_SOURCE symbol is documented for application use.) The _SOCKLEN_T symbol is not documented in any HP-UX manual. It is an internal implementation detail. An application that defines or changes its behavior based on this symbol is incorrect.
if you want to use POSIX API then use xopen socket preprocessors as defined in man xopen_networking.
Else the default API is BSD one.
So it is a code problem.
Also it is not because socklen_t is defined that accept() will use it in its API.
on hpux socklen_t is always a long.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2010 01:09 AM
09-13-2010 01:09 AM
Re: aCC compiler preprocessing assumes _SOCKLEN_T as defined in HP-UX 11.31
Is this reserving _[A-Z] introduced in HP-UX 11.31 onwards?
The compilation works fine in HP-UX 11.23.
We are using gSOAP library version 2.7.8 which is opensource. It is defined the _SOCKLEN_T and based on that defines
SOAP_SOCKLEN_T socklen_t
Where as in HP-UX it suppose to pick up define __hpux and assign
SOAP_SOCKLEN_T int
So I tried the sample program.
Now I am clear that I need to change this opensource header file accordingly to suite for HP-UX 11.31
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2010 01:18 AM
09-13-2010 01:18 AM
Re: aCC compiler preprocessing assumes _SOCKLEN_T as defined in HP-UX 11.31
In fact no it is ANSI C which tell that.
the diff between 11.23 and 11.31 is that a header file defines _SOCKLEN_T - for internal purpose definition facilities apparantly.
and yes you need to change gSOAP precheck code
if you want to use bsd semantic.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-13-2010 06:22 AM
09-13-2010 06:22 AM
SolutionIt is working fine on both OS versions.
>Is it a issue with compiler or environment?
The compiler only does what it is told. As Laurent said, this is a user problem due to the changes for Unix 2003 branding on 11.31.
> Is this reserving _[A-Z] introduced in HP-UX 11.31 onwards?
No, this Standard rule has always been there and the HP-UX headers take full advantage of it.
>I need to change this opensource header file accordingly to suite for HP-UX 11.31
It's unfortunate but you'll have to do that.
>Laurent: The ANSI C standard reserves all symbols starting with _[A-Z] for the implementation.
I see no C here. But the C++ Standard says the same thing and more.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2011 04:45 AM
01-10-2011 04:45 AM
Re: aCC compiler preprocessing assumes _SOCKLEN_T as defined in HP-UX 11.31
I have the same problem
What version of gSOAP installed to fix it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2011 07:58 AM
01-13-2011 07:58 AM
Re: aCC compiler preprocessing assumes _SOCKLEN_T as defined in HP-UX 11.31
I was facing the same problem in the build environment of our ISV partners. The final result of all the discussions was that the gSOAP code is wrong because it relies on a macro which is purely implementation defined (though open to changes). We finally agreed on changing the header files. Since this problem doesn't seem to be solved yet, I think it would be a good idea to put the developers' attention to this problem since their code doesn't work properly for all HP-UX versions.
Best regards,
Andre-Marcel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2011 08:17 AM
01-13-2011 08:17 AM
Re: aCC compiler preprocessing assumes _SOCKLEN_T as defined in HP-UX 11.31
We fixed it by correcting the header files of gSOAP for this version of HPUX.
Regards
-Raj