HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- compilation fails on Pa-risc2 but succeeds on ia6...
Operating System - HP-UX
1833083
Members
4019
Online
110050
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
Discussions
Forums
Discussions
back
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
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
08-10-2007 09:14 PM
08-10-2007 09:14 PM
Hi all,
I have a piece of code , the compilation of which fails on two different platforms.
1)$uname -a
HP-UX tivsc161 B.11.23 U 9000/785 2000950800 unlimited-user license
$cc +DD64 test1.c
cc: "test1.c", 34: 1653: , line : error : Case label too big for the type of the switch expression
Compiler details :
cpp.ansi: HP92453-01 B.11.11.10 HP C Preprocessor (ANSI)
ccom: HP92453-01 B.11.11.02 HP C Compiler
While on Itanium 11.23 :
2)uname -a
HP-UX tivsec15 B.11.23 U ia64 3018900438 unlimited-user license
The version of compiler is :
cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]
The code compiles without errors:
cics#iadce1#/home/cics/omar>
$cc +DD64 test1.c
cics#iadce1#/home/cics/omar>
The piece of code in question is:
#include
#include
#define test (-1765328347L)
int main()
{
unsigned int a=1;
switch(a)
{
case test:printf("In switch case\n");
default: printf("In default\n");
;
}
}
Why is it so ? It compiles on Itanium while fails on PARISC when a is declared as "unsigned int" . Shouldn't it fail on both the platforms ? ..... Is there any missing compiler flag or any flag which i can add on PARISC and made the code to compile ?
Thanks in advance
I have a piece of code , the compilation of which fails on two different platforms.
1)$uname -a
HP-UX tivsc161 B.11.23 U 9000/785 2000950800 unlimited-user license
$cc +DD64 test1.c
cc: "test1.c", 34: 1653: , line : error : Case label too big for the type of the switch expression
Compiler details :
cpp.ansi: HP92453-01 B.11.11.10 HP C Preprocessor (ANSI)
ccom: HP92453-01 B.11.11.02 HP C Compiler
While on Itanium 11.23 :
2)uname -a
HP-UX tivsec15 B.11.23 U ia64 3018900438 unlimited-user license
The version of compiler is :
cc: HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]
The code compiles without errors:
cics#iadce1#/home/cics/omar>
$cc +DD64 test1.c
cics#iadce1#/home/cics/omar>
The piece of code in question is:
#include
#include
#define test (-1765328347L)
int main()
{
unsigned int a=1;
switch(a)
{
case test:printf("In switch case\n");
default: printf("In default\n");
;
}
}
Why is it so ? It compiles on Itanium while fails on PARISC when a is declared as "unsigned int" . Shouldn't it fail on both the platforms ? ..... Is there any missing compiler flag or any flag which i can add on PARISC and made the code to compile ?
Thanks in advance
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2007 10:16 PM
08-10-2007 10:16 PM
Re: compilation fails on Pa-risc2 but succeeds on ia64
You are dealing with two different compilers.
>any flag which i can add on PA-RISC and made the code to compile?
If you want it to compile you should cast the case label to unsigned int. Or cast "a" to a long.
I'll have to check the Standard about the promotion rules for case labels vs the switch variable.
Note the Integrity compiler you have, A.05.55, is obsolete and not supported. The latest version is A.06.14.
>any flag which i can add on PA-RISC and made the code to compile?
If you want it to compile you should cast the case label to unsigned int. Or cast "a" to a long.
I'll have to check the Standard about the promotion rules for case labels vs the switch variable.
Note the Integrity compiler you have, A.05.55, is obsolete and not supported. The latest version is A.06.14.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2007 04:12 AM
08-11-2007 04:12 AM
Re: compilation fails on Pa-risc2 but succeeds on ia64
Hi,
>> Compiler details :
>> cpp.ansi: HP92453-01 B.11.11.10 HP C Preprocessor (ANSI)
>> ccom: HP92453-01 B.11.11.02 HP C Compiler
Load in these OS Patches if applicable:
PHSS_28435 linker startup code / SLLIC ELF support
PHSS_34880 LIBCL patch
PHSS_35175 HP C Preprocessor B.11.11.16 cumulative patch
PHSS_35383 ld(1) and linker tools cumulative patch
PHSS_36086 ANSI C compiler B.11.11.16 cumulative patch
PHSS_36088 +O4/PBO Compiler B.11.11.16 cumulative patch
Perform the compilation again.
Thanks
>> Compiler details :
>> cpp.ansi: HP92453-01 B.11.11.10 HP C Preprocessor (ANSI)
>> ccom: HP92453-01 B.11.11.02 HP C Compiler
Load in these OS Patches if applicable:
PHSS_28435 linker startup code / SLLIC ELF support
PHSS_34880 LIBCL patch
PHSS_35175 HP C Preprocessor B.11.11.16 cumulative patch
PHSS_35383 ld(1) and linker tools cumulative patch
PHSS_36086 ANSI C compiler B.11.11.16 cumulative patch
PHSS_36088 +O4/PBO Compiler B.11.11.16 cumulative patch
Perform the compilation again.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2007 06:29 PM
08-13-2007 06:29 PM
Solution
>Shaolin: Load in these OS Patches if applicable: ...
These won't help. This is a bug in the PA compiler. You need to contact the Response Center.
The Integrity compiler meets the C++ and C99 Standards where each case label is implicitly converted to the promoted type of the switch condition.
Though in your case, your negative long will be converted to an unsigned int. This is a maintenance nightmare waiting to happen.
These won't help. This is a bug in the PA compiler. You need to contact the Response Center.
The Integrity compiler meets the C++ and C99 Standards where each case label is implicitly converted to the promoted type of the switch condition.
Though in your case, your negative long will be converted to an unsigned int. This is a maintenance nightmare waiting to happen.
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 2025 Hewlett Packard Enterprise Development LP