You just shouldn't use a bitwise operator on Boolean values. Apparently the compiler promotes the output of funcReturningBool
or the variable flag
to a signed integer, and warns you of possible unexpected effects.
You should stick to Boolean operators. Had &&=
existed, you could have written flag &&= funcReturningBool();
. Instead, use flag = flag && funcReturningBool();