[PATCH] build: avoid older gcc warning

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

 



Jim Fehlig reported a compilation error with older gcc 4.3.4:

libvirt.c: In function 'virDomainGetEmulatorPinInfo':
libvirt.c:9111: error: logical '&&' with non-zero constant will always evaluate as true [-Wlogical-op]

It looks like someone programmed via too much copy-and-paste.

* src/libvirt.c (virDomainGetEmulatorPinInfo): Multiplying by 1 is
a no-op, and thus will never overflow.
---

Pushing under the build-breaker rule.

 src/libvirt.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/libvirt.c b/src/libvirt.c
index 43591c0..ada9a86 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -9108,11 +9108,6 @@ virDomainGetEmulatorPinInfo(virDomainPtr domain, unsigned char *cpumap,
         virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
         goto error;
     }
-    if (INT_MULTIPLY_OVERFLOW(1, maplen)) {
-        virLibDomainError(VIR_ERR_OVERFLOW, _("input too large: 1 * %d"),
-                          maplen);
-        goto error;
-    }

     /* At most one of these two flags should be set.  */
     if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
-- 
1.7.11.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]