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]
Date:	Mon, 8 Sep 2014 13:32:08 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Spencer Baugh <sbaugh@...rew.cmu.edu>,
	"open list:STAGING SUBSYSTEM" <devel@...verdev.osuosl.org>,
	gregkh@...uxfoundation.org,
	Hongchao Zhang <hongchao.zhang@...el.com>,
	Niu Yawei <yawei.niu@...el.com>,
	Alex Zhuravlev <alexey.zhuravlev@...el.com>,
	open list <linux-kernel@...r.kernel.org>,
	Oleg Drokin <oleg.drokin@...el.com>
Subject: Re: [PATCH 2/3] staging: lustre: fix pointer whitespace style

On Sat, Sep 06, 2014 at 11:19:03AM -0700, Joe Perches wrote:
> 
> Indexing a string array with an enum is generally unsafe.
> 
> I think it better to use a switch/case like:
> 

The reverse side of that argument is that switch statements are slower
and uglier.

My understanding is that according to the c spec, "state" could be
signed but in this case GCC defines it as unsigned int.  So the ASSERT
is ok in real life, but in theory it should check for negatives as well.

regards,
dan carpenter

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