What's the advantage of ever using cmp over just always using cmp_once?
If it can't tell that the cmp_once is a constant expression why can it tell that cmp is a constant expression?
EDIT: I think I get it. In the event that the arguments are constant, something about the typeof business prevents it from being constant, so that's no good if required in a context where a constant is required. But, when not required to be a constant expression, you want to enforce single-evaluation of the arguments, so then cmp_once is used.
foo() > bar() ? foo() : bar()
can have a different result than int __x = foo();
int __y = bar();
__x > __y ? __x : __y int things[max(size1, size2)];
and there's been recently a push to remove all VLAs (arrays with non constant size) from the kernel. The -Wvla flag was warning about these arrays even though they're actually constant size, so something needed to be done.