From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K3csW-0005AP-Tz for qemu-devel@nongnu.org; Tue, 03 Jun 2008 16:13:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K3csV-00059x-CB for qemu-devel@nongnu.org; Tue, 03 Jun 2008 16:13:08 -0400 Received: from [199.232.76.173] (port=48582 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K3csV-00059m-5p for qemu-devel@nongnu.org; Tue, 03 Jun 2008 16:13:07 -0400 Received: from hs-out-0708.google.com ([64.233.178.246]:34964) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K3csV-00040j-Db for qemu-devel@nongnu.org; Tue, 03 Jun 2008 16:13:07 -0400 Received: by hs-out-0708.google.com with SMTP id k27so1500296hsc.2 for ; Tue, 03 Jun 2008 13:13:06 -0700 (PDT) Message-ID: <4845A5C4.6050309@codemonkey.ws> Date: Tue, 03 Jun 2008 15:12:52 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] New qemu-img convert -B option to preserve the COW aspect of images and/or re-base them References: <48459641.5040000@codemonkey.ws> <20080603194041.GE6899@shareable.org> In-Reply-To: <20080603194041.GE6899@shareable.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Jamie Lokier wrote: > Anthony Liguori wrote: > >>> + if (!bs->drv->bdrv_is_allocated) { >>> + if (sector_num >= bs->total_sectors) { >>> + *pnum = 0; >>> + return 0; >>> + } >>> + int64_t n = bs->total_sectors - sector_num; >>> >> Don't mix declarations with code. >> > > Suggest: compile with "gcc -Wdeclaration-after-statement". > > Though, since declarations after statements are supported by GCC 3.0+ > (according to "man gcc"), and GCC is required to compile > QEMU... perhaps it's not such a bad thing to allow it/ > It's sloppy. In general, using a non-portable feature for no good reason other than you can is bad practice (even if we do depend on GCC). Regards, Anthony Liguori > -- Jamie > > >