GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HP-UX/IA64 and HP C : Is "__typeof__" keyword sup...
Operating System - HP-UX
1848332
Members
8013
Online
104024
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
11-06-2009 04:20 AM
11-06-2009 04:20 AM
I am attempting to make use of either the "__typeof__" or "typeof" keyword in some C code. Unfortunately I have tried both with various cc command options and neither seem to be recognised by the compiler. Does anyone know if they are supported?
HP-UX Version (uname -s -n -r -v -m):
HP-UX hpitaniu B.11.23 U ia64
HP C Version (cc -V):
cc: HP C/aC++ B3910B A.06.20 [May 13 2008]
Simple program I testing with:
1 #include
2 #include
3
4 int main(int argc, char **argv)
5 {
6 int i = 0;
7 __typeof__ (i) x = 2;
8
9 fprintf(stdout, "i=%d, x=%d\n", i, x);
10
11 return(EXIT_SUCCESS);
12 }
Two command lines I have tried:
--------------------------------8<--------------------
prompt>cc try_typeof.c
"try_typeof.c", line 7: error #2065: expected a ";"
__typeof__ (i) x = 2;
^
"try_typeof.c", line 9: error #2020: identifier "x" is undefined
fprintf(stdout, "i=%d, x=%d\n", i, x);
^
2 errors detected in the compilation of "try_typeof.c".
--------------------------------8<--------------------
prompt> cc -AC99 try_typeof.c
demo mode expires on 12/05/09 (28 days from now).
"try_typeof.c", line 7: warning #2223-D: function "__typeof__" declared
implicitly
__typeof__ (i) x = 2;
^
"try_typeof.c", line 7: error #2065: expected a ";"
__typeof__ (i) x = 2;
^
"try_typeof.c", line 9: error #2020: identifier "x" is undefined
fprintf(stdout, "i=%d, x=%d\n", i, x);
^
2 errors detected in the compilation of "try_typeof.c".
--------------------------------8<--------------------
HP-UX Version (uname -s -n -r -v -m):
HP-UX hpitaniu B.11.23 U ia64
HP C Version (cc -V):
cc: HP C/aC++ B3910B A.06.20 [May 13 2008]
Simple program I testing with:
1 #include
2 #include
3
4 int main(int argc, char **argv)
5 {
6 int i = 0;
7 __typeof__ (i) x = 2;
8
9 fprintf(stdout, "i=%d, x=%d\n", i, x);
10
11 return(EXIT_SUCCESS);
12 }
Two command lines I have tried:
--------------------------------8<--------------------
prompt>cc try_typeof.c
"try_typeof.c", line 7: error #2065: expected a ";"
__typeof__ (i) x = 2;
^
"try_typeof.c", line 9: error #2020: identifier "x" is undefined
fprintf(stdout, "i=%d, x=%d\n", i, x);
^
2 errors detected in the compilation of "try_typeof.c".
--------------------------------8<--------------------
prompt> cc -AC99 try_typeof.c
demo mode expires on 12/05/09 (28 days from now).
"try_typeof.c", line 7: warning #2223-D: function "__typeof__" declared
implicitly
__typeof__ (i) x = 2;
^
"try_typeof.c", line 7: error #2065: expected a ";"
__typeof__ (i) x = 2;
^
"try_typeof.c", line 9: error #2020: identifier "x" is undefined
fprintf(stdout, "i=%d, x=%d\n", i, x);
^
2 errors detected in the compilation of "try_typeof.c".
--------------------------------8<--------------------
Solved! Go to Solution.
- Tags:
- typeof
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2009 04:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2009 04:54 AM
11-06-2009 04:54 AM
Re: HP-UX/IA64 and HP C : Is "__typeof__" keyword supported?
Thanks Dennis. I didn't spot that option. I tried it and it did the trick.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2026 Hewlett Packard Enterprise Development LP