sema bug handling __sync_val_compare_and_swap/__sync_lock_test_and_set #6685
Labels
bugzilla
Issues migrated from bugzilla
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Extended Description
Here's the testcase :
#define __INTRIN_INLINE extern inline attribute((always_inline,gnu_inline))
__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
{
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
}
__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
{
/* NOTE: ditto */
__sync_synchronize();
return __sync_lock_test_and_set(Target, Value);
}
This compiles fine in mingw32-gcc, but in clang I get two warnings :
warning: incompatible integer to pointer conversion returning 'int', expected 'void *'
return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
warning: incompatible integer to pointer conversion returning 'int', expected 'void *'
return __sync_lock_test_and_set(Target, Value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The text was updated successfully, but these errors were encountered: