You really are not looking for anything. sizeof not evaluated if it is not a VLA. The language is explicitly permitted by the language to host any "garbage" you want as an argument to sizeof . The language guarantees that it will not evaluate anything, just do an analysis of the compilation time of the type of expression. For example, the expression sizeof i++ guaranteed not to change the value of i .
The only exception to this rule is variable length arrays. The sizeof for the VLA is a run-time value, which means that the argument is evaluated and must be valid.
source share