3 ms·
It can be hard or even impossible to prove that a variable gets read before it gets written to. People who want to get every last bit of performance out of the
by Someone 11y ago
It can be hard or even impossible to prove that a variable gets read before it gets written to.
People who want to get every last bit of performance out of their systems do want to write code like:
int x;
...
if(condition1) x = expression1;
...
while(expression2)
{
x = DoSomethingWith(x);
}
where the intelligent reader knows things are fine, but a compiler has a hard time proving it. For example, a contract implicit in an API may enforce the invariant, but that cannot be deduced from the code.