diff mbox

[kvm-unit-tests,v1] lib: fix compilation warning

Message ID 20170512104723.9469-1-david@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Hildenbrand May 12, 2017, 10:47 a.m. UTC
GCC doesn't like comparison of signed and unsigned values.

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 lib/report.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Huth May 12, 2017, 12:22 p.m. UTC | #1
On 12.05.2017 12:47, David Hildenbrand wrote:
> GCC doesn't like comparison of signed and unsigned values.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  lib/report.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/report.c b/lib/report.c
> index aa23b65..f7af596 100644
> --- a/lib/report.c
> +++ b/lib/report.c
> @@ -29,7 +29,7 @@ void report_pass(void)
>  void report_prefix_pushf(const char *prefix_fmt, ...)
>  {
>  	va_list va;
> -	int len;
> +	unsigned int len;
>  	int start;
>  
>  	spin_lock(&lock);

This fixes the problem for me, too:

Tested-by: Thomas Huth <thuth@redhat.com>
Radim Krčmář May 12, 2017, 3:11 p.m. UTC | #2
2017-05-12 12:47+0200, David Hildenbrand:
> GCC doesn't like comparison of signed and unsigned values.
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---

Applied, thanks.
diff mbox

Patch

diff --git a/lib/report.c b/lib/report.c
index aa23b65..f7af596 100644
--- a/lib/report.c
+++ b/lib/report.c
@@ -29,7 +29,7 @@  void report_pass(void)
 void report_prefix_pushf(const char *prefix_fmt, ...)
 {
 	va_list va;
-	int len;
+	unsigned int len;
 	int start;
 
 	spin_lock(&lock);