Skip to content

sema bug handling __sync_val_compare_and_swap/__sync_lock_test_and_set #6685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
llvmbot opened this issue Feb 16, 2010 · 2 comments
Closed
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@llvmbot
Copy link
Member

llvmbot commented Feb 16, 2010

Bugzilla Link 6313
Resolution FIXED
Resolved on Feb 17, 2011 22:16
Version trunk
OS Windows NT
Blocks llvm/llvm-bugzilla-archive#6815
Reporter LLVM Bugzilla Contributor

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);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@lattner
Copy link
Collaborator

lattner commented Feb 18, 2011

This got fixed some time back.

@llvmbot
Copy link
Member Author

llvmbot commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#6815

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

No branches or pull requests

2 participants