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: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH] raw-posix: Fix build without is_allocated support
Date: Wed, 20 Jun 2012 11:49:24 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

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)

> 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?

Kevin



reply via email to

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