qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] New qemu-img convert -B option to preserve the


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] New qemu-img convert -B option to preserve the COW aspect of images and/or re-base them
Date: Tue, 03 Jun 2008 15:12:52 -0500
User-agent: Thunderbird 2.0.0.14 (X11/20080501)

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







reply via email to

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