What should __sync_bool_compare_and_swap be on ia64?

H. J. Lu hjl@lucon.org
Fri Apr 4 19:42:00 GMT 2003


I got

# cat x.c
#include <ia64intrin.h>
 
int
foo (long **x, long *i)
{
  return __sync_bool_compare_and_swap (x, 0L, i);
}
# gcc -Wall x.c -c 
x.c: In function `foo':
x.c:6: warning: cast from pointer to integer of different size
x.c:6: warning: cast to pointer from integer of different size
x.c:6: warning: return makes integer from pointer without a cast

I have 2 questions:

1. According to my ia64 psABI, __sync_bool_compare_and_swap should
return int. But gcc's version doesn't.
2. Why do I got warnings about casting of different size?


H.J.



More information about the Gcc mailing list