I doubt that the principle holds for enums. Enumerations are guaranteed by the standard to be able to hold any value between the smallest and the largest value defined. So, in theory, it is not considered undefined behaviour.

Tested with GCC 4.7 w/ default settings: The compiler did not optimize away the Printf. (`BlockFaceToString((eBlockFace) 10000)` => `Unknown BLOCK_FACE: 10000`)