Paolo Bonzini <pbonz...@redhat.com> wrote:
> On 4/26/23 22:10, Juan Quintela wrote:
>> Don't use __nocheck() functions.
>
> Doesn't this break on 32-bit platforms?
>
> #if defined(__x86_64__) || defined(__sparc__) || defined(__mips64)
> # define ATOMIC_REG_SIZE  8
> #else
> # define ATOMIC_REG_SIZE  sizeof(void *)
> #endif
>
> #define qatomic_set(ptr, i)  do {                      \
>     qemu_build_assert(sizeof(*ptr) <= ATOMIC_REG_SIZE); \
>     qatomic_set__nocheck(ptr, i);                      \
> } while(0)
>
> So if sizeof(void*) == 4 it would trigger a compile-time assertion.
>
> Paolo

Yeap.

Really I was waiting for stat64_set() that you have just sent, will do
it on top of that.

And yes, I already broke the build with that patch.

Later, Juan.


Reply via email to