Hello,
I agree, it's confusing.
a) This is because the whole switch statement is parsed before an attempt is made to generate code. It's during code generation that constant folding will trigger a warning. At least not trivial to match expressions to previously parsed source lines. I guess this is why it's not being done today...
b) This has to do with code generation. Several of the values are consecutive, so a jump-table is used (all cases except E_UNEXPECTED). It's the special "use jump-table" code that trigger the warnings.
Pelle