qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] raw-posix: Fix build without is_allocated suppo


From: Alexander Graf
Subject: Re: [Qemu-devel] [PATCH] raw-posix: Fix build without is_allocated support
Date: Wed, 20 Jun 2012 11:53:06 +0200

On 20.06.2012, at 11:49, Kevin Wolf wrote:

> Am 20.06.2012 11:36, schrieb Alexander Graf:
>> 
>> On 20.06.2012, at 10:02, Kevin Wolf wrote:
>> 
>>> Move the declaration of s into the #ifdef sections that actually make
>>> use of it.
>>> 
>>> Signed-off-by: Kevin Wolf <address@hidden>
>> 
>> Yup, that fixes it for me. Btw, when did we start declaring variables within 
>> actual code? Most of the QEMU code follows the "variables have to be 
>> declared on the top of a block" methodology.
> 
> Yes, and generally I think this is good style because it improves
> readability. I see #ifdef blocks as an exception because logically and
> visually they are separate blocks, even though they aren't in C. But C99
> allows this, so why not use it in this case. (And I think you can find
> more examples like this in qemu where it's used with #ifdef)

Well, had I known that this is valid coding style wise, I could've simplified a 
bit of ppc kvm code, where we duplicate the #ifdef - once for the definition 
and once for the actual code.

> 
>> Tested-by: Alexander Graf <address@hidden>
> 
> Thanks for testing. Just out of curiosity, which host platform did you
> even use to get the fallback case?

This is on my PPC test machine, which is running openSUSE 11.1, which is the 
last released openSUSE PPC version :).


Alex




reply via email to

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