Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 29 Jun 2012 22:54:58 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Re: GPU formats vs. -Wdeclaration-after-statement

On 2012-06-29 22:44, Solar Designer wrote:
> BTW, it appeared like some of this kind of fixes (made a few days ago),
> perhaps Dhiru's, were too aggressive.  Specifically, this is OK and does
> not need fixing:
> 
> void f(void)
> {
> ...
> 	while (cond) {
> 		int var;
> 		...
> 	}
> }
> 
> What I think I've seen is "int var;" being moved to start of function in
> such cases.  This is not the kind of change we want to be making.  When
> there's already a block inside a function, and a variable can be local
> to that scope - it should stay there.
> 
> What we're trying to enforce is that variables be declared at the start
> of each block, before the first statement.

Wot he said. And now that J6 was released, I put the
-Wdeclaration-after-statement in magnum-jumbo too and as long as you
don't get a complaint, you don't likely need to fix anything.

magnum

Powered by blists - more mailing lists

Your e-mail address:

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.