#pragma warning( disable : 4800 ) // forcing bool 'true' or 'false' ,忽略4800 警告
#pragma warning( disable : 4786 ) // truncating debug information to 255 chars 忽略4786 警告
'type' : forcing value to bool 'true' or 'false' (performance warning)
This warning is generated when a value that is not bool is assigned or coerced into type bool. Typically, this message is caused by assigning int variables tobool variables where the int variable contains only values true and false, and could be redeclared as type bool. If you cannot rewrite the expression to use typebool, then you can add "!=0" to the expression, which gives the expression type bool. Casting the expression to type bool will not disable the warning, which is by design.
The following sample generates C4800:
// C4800.cpp // compile with: /W3 int main() { int i = 0; // try.. // bool i = 0; bool j = i; // C4800 j++; }