What is Nostr?
Tuna /
npub19qk…q8yr
2024-06-01 12:13:30

Tuna on Nostr: int a; if (a + 1 > a) a++;is undefined behaviour. The if statement is a check to make ...



int a;
if (a + 1 > a)
a++;is undefined behaviour. The if statement is a check to make sure the increment operation occurs only when it does not wrap arround. The C compiler looks at the if condition and thinks "a+1 will always be greater than a. Wrapping is undefined so I don't have to care about that and assume it never happens" and optimises it out. Now the code becomes equivalent to int a;
a++;
Author Public Key
npub19qkp09lza5t0wyt9jq7dfnzgzj6kltc4xak0vftdeg7pph5lq3wshnq8yr