Skip to content

Commit cb5d6a5

Browse files
committed
[llvm][ADT] Fix Arm 32 bit compilation warning in lazy atomic pointer
LazyAtomicPointer.h:36:49: warning: implicit conversion from 'unsigned long long' to 'uintptr_t' (aka 'unsigned int') changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion] static constexpr uintptr_t getBusy() { return -1ULL; } On 32 bit Arm ULL is an unsigned long long which is 8 bytes, but uintptr_t is 4 bytes. Instead of using a value, use the macro UINTPTR_MAX that will be the correctly sized value.
1 parent ab8ac36 commit cb5d6a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/ADT/LazyAtomicPointer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ namespace llvm {
3333
/// std::atomic<T>::notify_all() in \a loadOrGenerate().
3434
template <class T> class LazyAtomicPointer {
3535
static constexpr uintptr_t getNull() { return 0; }
36-
static constexpr uintptr_t getBusy() { return -1ULL; }
36+
static constexpr uintptr_t getBusy() { return UINTPTR_MAX; }
3737

3838
static T *makePointer(uintptr_t Value) {
3939
assert(Value != getBusy());

0 commit comments

Comments
 (0)