- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: compilation error-aCC [ bool int confusion ]
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
тАО07-02-2009 02:57 AM
тАО07-02-2009 02:57 AM
I am currently wrestling with a compiler error thrown while compiling a relative archaic piece of application code with aCC( A.03.70). The code compiles fine with a previous aCC(A.03.25).Platform HP-UX 11.11 PA-RISC
Error
526: "/opt/aCC/include/iostream/iostream.h", line 406 # Class member function declaration is indistinguishable from "istream
&istream::operator >>(int &)" already declared at ["/opt/aCC/include/iostream/iostream.h", line 384].
istream& operator>>(int&);
^^
Error 526: "/opt/aCC/include/iostream/iostream.h", line 563 # Class member function declaration is indistinguishable from "ostream
&ostream::operator <<(int)" already declared at ["/opt/aCC/include/iostream/iostream.h", line 547].
ostream& operator<<(bool b) { return *this << (int)b ; }
^^
Error 445: "/opt/aCC/include/iostream/iostream.h", line 563 # Cannot recover from earlier errors.
ostream& operator<<(bool b) { return *this << (int)b ; }
in iostream.h
line 406 -> istream& operator>>(int&);
line 384 -> istream& operator>>(bool&);
I am using the following compiler options
+Z -D_REENTRANT -AP -D_HPUX_SOURCE -O +DS2.0 +DA2.0 -z -D_REENTRANT -D_THREAD_SAFE -D__HPACC_THREAD_SAFE_RB_TREE -DRWSTD_MULTI_THREAD -DRW_MULTI_THREAD
I would prefer the default -AP option rather than -AA .
Can anybody provide pointers to resolve this.
Thanks
Vinay
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 06:03 AM
тАО07-02-2009 06:03 AM
Re: compilation error-aCC [ bool int confusion ]
line 406 -> istream& operator>>(int&);
line 384 -> istream& operator>>(bool&);
You probably have an evil macro that defines bool as int.
>-D_REENTRANT -D_THREAD_SAFE -DRWSTD_MULTI_THREAD -DRW_MULTI_THREAD
You can replace these by just -mt.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 10:32 PM
тАО07-02-2009 10:32 PM
SolutionSince A.03.70 does not support any options like -dM you could use the following technique to find where you have defined the macro bool (incase it could not be find by simple grep). Include #define bool catch_bool_macro. Compile your source file with the original command line. You should get a warning with the location where the macro is (re)defined.
By the way, I see that if I define bool to an int I get the same error with A.03.25 as well like A.03.70.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-02-2009 11:02 PM - edited тАО08-28-2011 10:12 PM
тАО07-02-2009 11:02 PM - edited тАО08-28-2011 10:12 PM
Re: compilation error-aCC [ bool int confusion ]
>Kannan: Since A.03.70 does not support any options like -dM
Instead you use cpp.ansi:
... -E -.i +legacy_cpp -Wp,-C,-G
Then look for bool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2009 01:57 AM
тАО07-03-2009 01:57 AM
Re: compilation error-aCC [ bool int confusion ]
Once I provided the compiler option -DHPUX ,the redundancy was not included and compiled smoothly.
Extra thanks to Kannan for helping hunt down the error.
-Vinay