HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- aCC enum bug
Operating System - Linux
1827819
Members
1888
Online
109969
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
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
07-16-2006 07:08 PM
07-16-2006 07:08 PM
aCC enum bug
aCC 3.57 fails to compile this code, which is valid C++ and compiles with gcc, MSVC*, and more.
---
class A {
};
class B {
enum {
A,
C = A
};
};
---
Error 24: "main.cpp", line 7 # '' expected instead of 'A'.
C = A
^
Error 216: "main.cpp", line 8 # Integer constant expected in enumerator initialization.
};
^
---
class A {
};
class B {
enum {
A,
C = A
};
};
---
Error 24: "main.cpp", line 7 # '
C = A
^
Error 216: "main.cpp", line 8 # Integer constant expected in enumerator initialization.
};
^
- Tags:
- enum
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2006 12:34 AM
07-17-2006 12:34 AM
Re: aCC enum bug
Andreas,
I have only ever seen either:
enum{A,C};
or
enum{A,C=4);
After compiling your code in gcc, what happens at that statement,if you run it?
aCC may not let you compile because it could generate an invalid condition.
I have only ever seen either:
enum{A,C};
or
enum{A,C=4);
After compiling your code in gcc, what happens at that statement,if you run it?
aCC may not let you compile because it could generate an invalid condition.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2006 12:50 AM
07-17-2006 12:50 AM
Re: aCC enum bug
Enum values can always take the value of other enum values. This is commonly used in API design when an enum entry needs to be renamed, yet keep the same value. The condition is not invalid.
enum {
A,
B,
C = A // Value = 0.
};
This is also what happens when compiling it. C = A is the same as C = 0. aCC cannot compile this code; it's a bug in aCC :-).
enum {
A,
B,
C = A // Value = 0.
};
This is also what happens when compiling it. C = A is the same as C = 0. aCC cannot compile this code; it's a bug in aCC :-).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2006 08:44 PM
07-17-2006 08:44 PM
Re: aCC enum bug
Andreas is right, it is a bug.
It works fine with aCC6 and with A.03.67, PHSS_34414
It is CR JAGae88844: Error 24 Unable to distinguish b/w tentative class and enum constant
It works fine with aCC6 and with A.03.67, PHSS_34414
It is CR JAGae88844: Error 24 Unable to distinguish b/w tentative class and enum constant
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP