- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 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
тАО09-24-2009 10:01 AM
тАО09-24-2009 10:01 AM
Bool/int confusion
"collector.C", line 41: error #2418: more than one conversion function from
"mmm::predicate
function "mmm::predicate
function "mmm::predicate
The actual (relevant) code is:
template
class predicate {
public:
virtual operator bool();
T &operator=(T v);
operator T&();
.........
Finally, the entire, overly verbose compile statement (I love makefiles):
Compiling collector.C
/opt/aCC/bin/aCC -g0 -AP -v -w +z +Z +Maked +DD32 -DNOWHAT -I. -I/opt/siadev/jwinkle/SIA/DASC/include -I/opt/siadev/jwinkle/SIA/include_r -I/opt/EA2000_3.5.1.4/include -I. -I/opt/siadev/jwinkle/SIA/DASC/adapter/include -I/opt/siadev/jwinkle/SIA/DASC/common/include -I/opt/siadev/jwinkle/SIA/DASC/adapter/include -I/opt/siadev/jwinkle/SIA/include -I/opt/siadev/jwinkle/SIA/DASC/SAQ/external/include -I/opt/tuxdir/tuxedo8.1/include -I/opt/topcom/5.6/build/inc -I/usr/include -c collector.C
/opt/aCC/lbin/ecom -architecture 32 -makedepend file -ia64abi all -diag off -inst compiletime -sysdir /usr/include -inline_power 1 -link_type dynamic -fpeval float -fpevaldec _Decimal32 -tls_dyn on -target_os 11.23 -I. -I/opt/siadev/jwinkle/SIA/DASC/include -I/opt/siadev/jwinkle/SIA/include_r -I/opt/EA2000_3.5.1.4/include -I. -I/opt/siadev/jwinkle/SIA/DASC/adapter/include -I/opt/siadev/jwinkle/SIA/DASC/common/include -I/opt/siadev/jwinkle/SIA/DASC/adapter/include -I/opt/siadev/jwinkle/SIA/include -I/opt/siadev/jwinkle/SIA/DASC/SAQ/external/include -I/opt/tuxdir/tuxedo8.1/include -I/opt/topcom/5.6/build/inc -I/usr/include --sys_include /opt/aCC/include --sys_include /opt/aCC/include/iostream --sys_include /usr/include --sys_include /usr -D_HP_IA64ABI -D_BIND_LIBCALLS -D_Math_errhandling=MATH_ERREXCEPT -D__hpux -D__unix -D__ia64=1 -D__ia64__=1 -D_BIG_ENDIAN=1 -D__STDCPP__ -D_ILP32 -D__cplusplus=199711L -D__HP_aCC=62000 -D_HP_INSTANTIATE_T_IN_LIB -D_INLINE_ASM -D_FLT_EVAL_METHOD=0 -D_DEC_EVAL_METHOD=0 -DNOWHAT -debug debugG -ucode hdriver=optlevel%1% -plusolistoption -Ol06all! -plusolistoption -Ol13moderate! -plusooption -Oq01,al,ag,cn,sz,ic,vo,Mf,Po,es,rs,Rf,Pr,sp,in,cl,om,vc,pi,fa,pe,rr,pa,pv,nf,cp,lx,Pg,ug,lu,lb,uj,dn,sg,pt,kt,em,np,ar,rp,dl,fs,bp,wp,pc,mp,lr,cx,cr,pi,so,Rc,fa,ft,fe,ap,st,lc,Bl,sr,Qs,do,ib,pl,sd,ll,rl,dl,Lt,ol,fl,lm,ts,rd,dp,If! collector.C
WHY, oh why, does this think my bool is an int? I saw another post recently about this, and I am 100% certain that nowhere in our code is a bool being typedef, or #define'd, as an int.
- Tags:
- overloading
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2009 04:25 AM
тАО09-25-2009 04:25 AM
Re: Bool/int confusion
Why are you using -AP? You should use the default -AA.
Instead of using -w, you should suppress individual warnings with +Wnnnn.
You should also not specify the default include file paths.
>The actual (relevant) code is:
Where is the code that is using/calling this template?
You may have to use a cast hammer and tell the compiler exactly which function you want to call
>does this think my bool is an int?
Why do you think that? It is trying to convert a something?, mmm::predicate
I can duplicate the message with:
error #2418: more than one conversion function from "predicate
function "predicate
function "predicate
int i = 8 + P;
aCC3 doesn't seem to give an error.
Adding a hammer makes it work:
int i = 8 + (bool)P;
int i = 8 + static_cast
- Tags:
- suppress warnings
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2009 06:08 AM
тАО09-25-2009 06:08 AM
Re: Bool/int confusion
Instead of using -w, you should suppress individual warnings with +Wnnnn.
You should also not specify the default include file paths.
I took out the default include paths, FWIW. We are using -AP and -w becuase we are migrating over 200MB of code, and are essentially doing so in stages. Once it builds without errors, we'll worry about warnings.
>Where is the code that is using/calling this template?
mmm::predicate
......
"collector.C", line 154: error #2418: more than one conversion function from
"mmm::predicate
function "mmm::predicate
function "mmm::predicate
while (SIGTERM != alarm) {
^
>Why do you think that? It is trying to convert a something?, mmm::predicate
My understanding is, SIGTERM is an int, and alarm is predicate
While doing a cast would work, this is used in a bunch of places, and I don't really want to make 100 edits, when hopefully 1 fix would suffice.
I'd be more than happy to be told my understandings are wrong here. I've been living in C# and scripting languages for the last 8 or 9 years, so my C++ is still a bit fuzzy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2009 09:46 AM
тАО09-25-2009 09:46 AM
Re: Bool/int confusion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-25-2009 08:20 PM
тАО09-25-2009 08:20 PM
Re: Bool/int confusion
The Standard says both int and bool have equal precedence in operator overloading.
>when hopefully 1 fix would suffice.
Remove the operator bool but it must be important since it is virtual.
>Found my answer here:
Right: "these conversion functions may interfere with perfectly valid conversions and overloads."