From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O4lgG-0002Le-Pl for qemu-devel@nongnu.org; Wed, 21 Apr 2010 21:58:16 -0400 Received: from [140.186.70.92] (port=43416 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O4lgE-0002Kg-UD for qemu-devel@nongnu.org; Wed, 21 Apr 2010 21:58:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O4lg9-0000al-3u for qemu-devel@nongnu.org; Wed, 21 Apr 2010 21:58:14 -0400 Received: from mail-bw0-f211.google.com ([209.85.218.211]:59207) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O4lg8-0000ag-Sc for qemu-devel@nongnu.org; Wed, 21 Apr 2010 21:58:09 -0400 Received: by bwz3 with SMTP id 3so7397421bwz.11 for ; Wed, 21 Apr 2010 18:58:07 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 22 Apr 2010 03:58:07 +0200 Message-ID: From: andrzej zaborowski Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [RFC, PATCH 2/2] bt-sdp: Fix if statement with empty body, spotted by clang List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel On 18 April 2010 10:52, Blue Swirl wrote: > Fix clang error: > =C2=A0CC =C2=A0 =C2=A0bt-sdp.o > /src/qemu/hw/bt-sdp.c:174:17: error: if statement has empty body [-Wempty= -body] > =C2=A0 =C2=A0if (len > 1); > > However, fixing this means that some code that was previously > ignored by the compiler now gets compiled, resulting in this error: > =C2=A0CC =C2=A0 =C2=A0bt-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