3 ms·
Their solution is well-defined but depends on undefined behavior. My understanding is that the casting is simply to prevent the compiler from optimizing out the
by dmm 17y ago
Their solution is well-defined but depends on undefined behavior. My understanding is that the casting is simply to prevent the compiler from optimizing out the check.
if((uintptr_t)buf+len < (uintptr_t)buf)
might fail to give the expected result if the address space is segmented.