4 ms·
It might be obvious to people with some experience. Many C programmers never read the standard or understand how the language works exactly, though. And to thos
by ygra 13y ago
It might be obvious to people with some experience. Many C programmers never read the standard or understand how the language works exactly, though. And to those people it might not immediately be obvious that for the strlen to be hoisted out of the loop the compiler would have to guarantee that the string's memory cannot change at all during the same loop. And that any function call can already lead to the compiler giving up trying to guarantee that.