- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cc compiler problem
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
Discussions
Discussions
Forums
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
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
тАО04-26-2010 02:02 AM
тАО04-26-2010 02:02 AM
I have a simple c code like this:
#define _HPUX_API_LEVEL 20040821
#if !defined(__GNUC__) || (__GNUC__ < 2)
# define __attribute__(x)
#endif
#include
#include
#include
#include
int main()
{
struct utsname osname;
if(uname(&osname)<0)
{
printf("%d %s\n",errno,strerror(errno));
printf("error\n");
}
printf("%s\n",osname.release);
return 0;
}
to use the expand hostname.
But if define the following line,it will
create errors:
72 Value too large to be stored in data type
error
#if !defined(__GNUC__) || (__GNUC__ < 2)
# define __attribute__(x)
#endif
The reason is that in the /usr/include/sys/stdsyms.h there is line:
#define _HPUX_API_VERS_20040821_ATTR __attribute__((version_id("20040821")))
That may be cause the error.
So can anyone give me some help?
Thanks!
Kevin,
Solved! Go to Solution.
- Tags:
- uname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2010 02:39 AM
тАО04-26-2010 02:39 AM
Solution#if !defined(__GNUC__) || (__GNUC__ < 2)
# define __attribute__(x)
You can't do this if you want to use longer hostnames.
>if define the following line, it will create errors:
Yes. It appears you already know the cause and answer, remove those bogus #if lines.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-26-2010 05:36 PM
тАО04-26-2010 05:36 PM
Re: cc compiler problem
My OS is :
uname -a
HP-UX test567890 B.11.31 U 9000/800 2404418694 unlimited-user license
And the cc version is :
what /opt/ansic/bin/cc
/opt/ansic/bin/cc:
$Revision: 92453-07 linker linker crt0.o B.11.53 060807 $
LINT B.11.11.18 CXREF B.11.11.18
HP92453-01 B.11.11.18 HP C Compiler
$ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2010 12:45 AM
тАО04-27-2010 12:45 AM
Re: cc compiler problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2010 01:16 AM
тАО04-27-2010 01:16 AM
Re: cc compiler problem
Thank you very much, now i have no questions about this!