When I compile the below code snippet code in Visual studio 2008, I get this warning.
BOOL
CPlan::getStandardPlan() const
{
return m_standardPlan;
}
bool m_bStandardPlan;
if(plan!=NULL)
{
// Assign the values to the Cola object
poCola->m_lPlanId = plan->getPlanId();
poCola->m_lPlanElementId = plan->getPlanElementId();
poCola->m_lPlanElementBaseId = plan->getPlanElementBaseId();
poCola->m_bStandardPlan = plan->getStandardPlan(); //C4800
return 1;
}
I referred the following links,
http://msdn.microsoft.com/en-us/library/b6801kcy%28v=vs.90%29.aspx
Forcing value to boolean: (bool) makes warning, !! doesnt
Warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
I'm not sure how to fix this warnings.
bool
instead ofBOOL
as a return value in the first place? – HenrikCPlan
looks much like a class from some MS library, so the signature cannot be changed. – Arne Mertz