]> xenbits.xensource.com Git - libvirt.git/commit
Turn 1<<31 into 1U<<31
authorMichal Privoznik <mprivozn@redhat.com>
Sat, 28 May 2016 11:38:46 +0000 (13:38 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Sat, 28 May 2016 11:49:14 +0000 (13:49 +0200)
commit0628f3498ce85ffb6d05c8143dc1610d84d91ad7
tree59636d29e866ba85e64696f263b9f7ea0efaddff
parent38df47c9af1997289a5dcb51c36e4604ce58d0dc
Turn 1<<31 into 1U<<31

Apparently, 1 << 31 is signed which in turn does not fit into
a signed integer variable:

../../include/libvirt/libvirt-domain.h:1881:57: error: result of '1 << 31' requires 33 bits to represent, but 'int' only has 32 bits [-Werror=shift-overflow=]
     VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS = 1 << 31, /* enforce requested stats */
                                                         ^~
cc1: all warnings being treated as errors

The solution is to make it an unsigned value. I've found only two
such occurrences in our code base.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
include/libvirt/libvirt-domain.h
src/util/virtypedparam.h