3 ms·
I think you've misread the question. Grandparent isn't asking why use cmp_once at all; they're asking, why not always force the single evaluation of x and y (i
by loeg 9y ago
I think you've misread the question. Grandparent isn't asking why use cmp_once at all; they're asking, why not always force the single evaluation of x and y (i.e., always use cmp_once)?
- tbodt 9y agoAh, that's because cmp_once doesn't yield a constant even when the inputs are constant. The reason that matters is there are some arrays in the kernel declared like 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.
- loeg 9y agoYep. https://news.ycombinator.com/item?id=16720118 https://news.ycombinator.com/item?id=16720118 is another good explanation :-).