3 ms·
Actually it's only undefined (per C99 anyway) if the return value is used: > If the } that terminates a function is reached, and the value of the function call
by nybble41 5y ago
Actually it's only undefined (per C99 anyway) if the return value is used:
> If the } that terminates a function is reached, and the value of the function call is used by the caller, the behavior is undefined.
So if the return value is never used then there is no undefined behavior and a standards-compliant compiler isn't allowed to optimize away the loop exit condition.