qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [RFC, PATCH 2/2] bt-sdp: Fix if statement with empty bo


From: andrzej zaborowski
Subject: [Qemu-devel] Re: [RFC, PATCH 2/2] bt-sdp: Fix if statement with empty body, spotted by clang
Date: Thu, 22 Apr 2010 03:58:07 +0200

On 18 April 2010 10:52, Blue Swirl <address@hidden> wrote:
> Fix clang error:
>  CC    bt-sdp.o
> /src/qemu/hw/bt-sdp.c:174:17: error: if statement has empty body 
> [-Wempty-body]
>    if (len > 1);
>
> However, fixing this means that some code that was previously
> ignored by the compiler now gets compiled, resulting in this error:
>  CC    bt-sdp.o
> cc1: warnings being treated as errors
> /src/qemu/hw/bt-sdp.c: In function 'sdp_svc_search':
> /src/qemu/hw/bt-sdp.c:184: error: 'max' may be used uninitialized in
> this function
>
> I could not figure out how to calculate max, so I just invented some
> figure to suppress the error.

Thanks, good catches, I applied fixes to both problems.

Turns out we were assigning the value of the "Max" parameter of the
request to the wrong variable, which was later overwritten anyway.  I
don't know what I was thinking...

Cheers




reply via email to

[Prev in Thread] Current Thread [Next in Thread]