qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] block/qcow2.h: Avoid "1LL << 63" (shifts into s


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH] block/qcow2.h: Avoid "1LL << 63" (shifts into sign bit)
Date: Wed, 28 Aug 2013 11:15:42 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 23.08.2013 um 18:35 hat Peter Maydell geschrieben:
> The expression "1LL << 63" tries to shift the 1 into the sign bit of a
> 'long long', which provokes a clang sanitizer warning:
> 
> runtime error: left shift of 1 by 63 places cannot be represented in type 
> 'long long'
> 
> Use "1ULL << 63" as the definition of QCOW_OFLAG_COPIED instead
> to avoid this. For consistency, we also update the other QCOW_OFLAG
> definitions to use the ULL suffix rather than LL, though only the
> shift by 63 is undefined behaviour.
> 
> Signed-off-by: Peter Maydell <address@hidden>

Thanks, applied to the block branch.

Kevin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]