lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B177878.2090002@redhat.com>
Date:	Thu, 03 Dec 2009 16:36:08 +0800
From:	Cong Wang <amwang@...hat.com>
To:	Alan Cox <alan@...ux.intel.com>
CC:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Joe Peterson <joe@...rush.com>
Subject: Re: [Patch] tty: move a definition out of switch block

Alan Cox wrote:
> On Tue, 1 Dec 2009 02:54:44 -0500
> Amerigo Wang <amwang@...hat.com> wrote:
> 
>> It's not good to leave a definition between 'switch'
>> and its first label. Move it out of the switch block.
> 
> "Not good". On what basis is it not good to put variables local to
> their scope ?
> 

Hello, Alan,

Generally putting variables local in the local scope is fine, but
not for 'switch' block, to be more precisely, not for the case
where putting local variables between 'switch' and its _first_
label, IMO.

It can lead to misunderstanding easily, since 'switch'
jumps to its first label at a first glance. I know in this case
the code is _not_ wrong, but again, it's not good for reading.

Also, there's no conflicts if we put it out of 'switch' block.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ