"if (a=b)" uses the "=" operator exactly as intended with perfectly legitimate uses. It's warned about because it's an error-prone construct, not because it's incorrect.
Seems to me 2^32 is also error-prone, if you wanted to combine flags you'd use 2|32, using xor here is weird.