Archived

This topic is now archived and is closed to further replies.

Compiler warning I don't understand

This topic is 5097 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't understand why the compiler doesn't like this statement:
void CBox::SetDebugState(DWORD newState)
{
	m_CBOX_DRAW_WIREFRAME = ((newState || CBOX_DRAW_WIREFRAME) > 0);
}
  
I just want to set m_CBOX_DRAW_WIREFRAME to true or false, depending on the bitmask flags in newState. Logically, the expression makes sense to me, but the compiler warns: c:\path\cbox.cpp(307) : warning C4804: '>' : unsafe use of type 'bool' in operation What's that warning mean and how do I fix it? [edited by - NogginBoink on January 4, 2004 12:39:45 PM]

Share this post


Link to post
Share on other sites