This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]