[libvirt] [PATCH python] Fix -Wsign-compare warnings

Cole Robinson posted 1 patch 2 weeks ago
Failed in applying to current master (apply log)
libvirt-override.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

[libvirt] [PATCH python] Fix -Wsign-compare warnings

Posted by Cole Robinson 2 weeks ago
libvirt-override.c: In function ‘libvirt_virConnectBaselineHypervisorCPU’:
libvirt-override.c:9946:23: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
libvirt-override.c:9961:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]

Use ssign_t as was similarly done in 75ec2acb6163b

Signed-off-by: Cole Robinson <crobinso@redhat.com>
---
 libvirt-override.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libvirt-override.c b/libvirt-override.c
index 5567f4a..ff2cfdf 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -9927,7 +9927,7 @@ libvirt_virConnectBaselineHypervisorCPU(PyObject *self ATTRIBUTE_UNUSED,
     unsigned int flags;
     char **xmlCPUs = NULL;
     int ncpus = 0;
-    size_t i;
+    ssize_t i;
     char *cpu;
     PyObject *ret = NULL;
 
-- 
2.21.0

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

Re: [libvirt] [PATCH python] Fix -Wsign-compare warnings

Posted by Ján Tomko 2 weeks ago
On Wed, Sep 04, 2019 at 01:41:56PM -0400, Cole Robinson wrote:
>libvirt-override.c: In function ‘libvirt_virConnectBaselineHypervisorCPU’:
>libvirt-override.c:9946:23: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
>libvirt-override.c:9961:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
>
>Use ssign_t as was similarly done in 75ec2acb6163b

s/sign/size/

>
>Signed-off-by: Cole Robinson <crobinso@redhat.com>
>---
> libvirt-override.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

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

Re: [libvirt] [PATCH python] Fix -Wsign-compare warnings

Posted by Pavel Hrdina 2 weeks ago
On Wed, Sep 04, 2019 at 01:41:56PM -0400, Cole Robinson wrote:
> libvirt-override.c: In function ‘libvirt_virConnectBaselineHypervisorCPU’:
> libvirt-override.c:9946:23: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
> libvirt-override.c:9961:19: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
> 
> Use ssign_t as was similarly done in 75ec2acb6163b
> 
> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  libvirt-override.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list