qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack


From: Andreas Färber
Subject: Re: [Qemu-devel] [PULL 16/16] target-i386: Move KVM default-vendor hack to instance_init
Date: Sun, 09 Feb 2014 11:13:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

Am 09.02.2014 09:06, schrieb Eduardo Habkost:
> On Sun, Feb 09, 2014 at 12:10:20AM +0000, Peter Maydell wrote:
>> On 8 February 2014 23:33, Paolo Bonzini <address@hidden> wrote:
>>> Il 08/02/2014 18:28, Andreas Färber ha scritto:
>>>> Since when is it OK to declare variables in the middle of the block?
>>
>>> When the code looks better, it is OK since always: checkpatch.pl doesn't
>>> complain and -Wdeclaration-after-statement is not added to the compiler
>>> flags.
>>
>> Huh? checkpatch is notoriously not a reliable guide, and we've had
>> the "declarations at start of block" rule since forever.
> 
> Sorry for my confusion, but I was not aware of that rule, and I don't
> know what I should use as a guide, if checkpatch.pl and CODING_STYLE are
> not enough. Is there additional coding style documentation or scripts I
> should look at?

HACKING exists as additional document, but it doesn't list it either.
There's a lot of unwritten rules that reoccur in review, such as no
QERR_*, no trailing \n in error_setg() and error_report(), ...

I think the history here is that QEMU didn't allow C99 some time back
and C89 (or ANSI C?) didn't allow declarations elsewhere. Blue was
fiercely in favor of keeping that rule (just like the
no-single-line-comments rule despite allowed from C99 on), saying that
goto statements might do the wrong thing otherwise. And I have been
advocating to make this rule more clear by uniformly separating
declarations from statements with a white line.

Andreas

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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