qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
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	[thread overview]
Message-ID: <4845A5C4.6050309@codemonkey.ws> (raw)
In-Reply-To: <20080603194041.GE6899@shareable.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
>
>
>   

  reply	other threads:[~2008-06-03 20:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-30  9:03 [Qemu-devel] [PATCH] New qemu-img convert -B option to preserve the COW aspect of images and/or re-base them Marc Bevand
2008-06-03 19:06 ` Anthony Liguori
2008-06-03 19:40   ` Jamie Lokier
2008-06-03 20:12     ` Anthony Liguori [this message]
2008-06-03 20:43       ` Jamie Lokier
2008-06-03 21:07         ` Andreas Färber
2008-06-03 21:28         ` Anthony Liguori
  -- strict thread matches above, loose matches on Subject: below --
2008-05-28  5:02 [Qemu-devel] [RFC] Allow 'qemu-img convert' to preserve the backing file Marc Bevand
2008-05-28  9:53 ` Ian Jackson
2008-05-28  9:55   ` Ian Jackson
2008-05-30  8:43     ` [Qemu-devel] " Marc Bevand
2008-05-30  9:21       ` [Qemu-devel] [PATCH] New qemu-img convert -B option to preserve the COW aspect of images and/or re-base them Marc Bevand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4845A5C4.6050309@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).