The allegedly \"clever\" (but actually inefficient) way of swapping two integer variables, instead of using temporary storage, often involves this line:
int
There are no sequence points in that expression, so it produces undefined behavior.
You could fix it trivially and retain most of the succinctness by using the comma operator, which does introduce sequence points:
a ^= b, b ^= a, a ^= b;