In this program:
int x, y;
int *old = &x;
int *new = &y;
int * volatile cur = &x;
OSAtomicCompareAndSwapPtrBarrier(old, new, &cur);
I get this warning:
Incompatible pointer passing 'int *volatile *' to parameter of type 'void *volatile *'
on XCode 4.0.1's default compiler. (Live Issues, actually.)
Now, I know that in general I can't cast int** to void** . But if I don't, I don't see any way to compare-and-swap and int* without getting the above warning. Should I just ignore the warning, assuming it's a relic from a time of non-uniform pointer sizes, or am I misunderstanding something?