[Top][All Lists]

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

Re: [Qemu-devel] [PATCH 8/9] lsi53c895a: avoid a warning from clang anal

From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 8/9] lsi53c895a: avoid a warning from clang analyzer
Date: Sun, 4 Sep 2011 18:05:52 +0100

On 4 September 2011 17:20, Avi Kivity <address@hidden> wrote:
> Why not keep id declared in the outer scope?  This extra indentation is
> annoying.

Personally I find that in a 125 line long function, declaring
a variable at function scope when it's actually used only in
a very small section of the code makes for worse readability:
you have to search through to confirm that it really is only
used in that small section. It gets worse if you have one
variable reused for several unrelated things.

So I think either the patch as submitted or the other approach
Blue Swirl suggests of just dropping the variable are better
than leaving id at function scope.

-- PMM

reply via email to

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