The panel's value is 3, or 0011 in the low four bits. The warning occupies the lowest bit, worth 1. Flip that bit with XOR and leave the next bit on. OR would not help here: it would keep the warning on.
warning in flags using ^ or ^=, then print Flags: 2 and a newline. Do not assign the answer directly.XOR with the one-bit warning mask flips that bit and leaves others unchanged.