
12 Mar
2010
12 Mar
'10
8:10 p.m.
AMDG Roland Bock wrote:
Stewart, Robert wrote:
C4800 seems ridiculous. Writing code using int as a Boolean is common to C code. Why would VC 9 inflict useless noise when compiling such code? Besides, if the variable is int, and it is needed in a Boolean context, what else would the developer do? I've seen use of the conditional operator to avoid that warning. I suspect that produces worse code than what is done when "forcing value to bool 'true' or 'false'."
I agree. Still, I hope that static_cast is allowed to remove C4800
Nope. .\scratch.cpp(20) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) In Christ, Steven Watanabe