This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
__sync_val_compare_and_swap and floats
- From: Christoph Bartoschek <bartoschek at gmx dot de>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 2 Apr 2010 13:17:41 +0200
- Subject: __sync_val_compare_and_swap and floats
Hi,
what is the recommended way to call __sync_val_compare_and_swap for a float
pointer?
On the platforms where the code should run a float is 4 bytes. Therefore we
casted to an int pointer which is also 4 bytes. However this gives us a
warning:
warning: dereferencing type-punned pointer will break strict-aliasing rules
How to do this correctly?
Christoph