[libvirt] [PATCH] Fix compilation error on 32bit

Below code failed to compile on a 32 bit machine with error typewrappers.c: In function 'libvirt_intUnwrap': typewrappers.c:135:5: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op] cc1: all warnings being treated as errors The patch fixes this error. Stefan --- python/typewrappers.c | 4 ++++ 1 file changed, 4 insertions(+) Index: libvirt-acl/python/typewrappers.c =================================================================== --- libvirt-acl.orig/python/typewrappers.c +++ libvirt-acl/python/typewrappers.c @@ -132,6 +132,7 @@ libvirt_intUnwrap(PyObject *obj, int *va if ((long_val == -1) && PyErr_Occurred()) return -1; +#if LONG_MAX != INT_MAX if (long_val >= INT_MIN && long_val <= INT_MAX) { *val = long_val; } else { @@ -139,6 +140,9 @@ libvirt_intUnwrap(PyObject *obj, int *va "Python int too large to convert to C int"); return -1; } +#else + *val = long_val; +#endif return 0; }

On 04/06/2012 01:13 PM, Stefan Berger wrote:
Below code failed to compile on a 32 bit machine with error
typewrappers.c: In function 'libvirt_intUnwrap': typewrappers.c:135:5: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op] cc1: all warnings being treated as errors
The patch fixes this error.
Stefan
--- python/typewrappers.c | 4 ++++ 1 file changed, 4 insertions(+)
ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 04/09/2012 12:23 PM, Eric Blake wrote:
On 04/06/2012 01:13 PM, Stefan Berger wrote:
Below code failed to compile on a 32 bit machine with error
typewrappers.c: In function 'libvirt_intUnwrap': typewrappers.c:135:5: error: logical 'and' of mutually exclusive tests is always false [-Werror=logical-op] cc1: all warnings being treated as errors
The patch fixes this error.
Stefan
--- python/typewrappers.c | 4 ++++ 1 file changed, 4 insertions(+) ACK.
Pushed.
participants (2)
-
Eric Blake
-
Stefan Berger