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: <29623.1165853572@redhat.com>
Date:	Mon, 11 Dec 2006 16:12:52 +0000
From:	David Howells <dhowells@...hat.com>
To:	Linus Torvalds <torvalds@...l.org>
Cc:	David Howells <dhowells@...hat.com>,
	Akinobu Mita <akinobu.mita@...il.com>, akpm@...l.org,
	linux-kernel@...r.kernel.org
Subject: Re: Mark bitrevX() functions as const 

Linus Torvalds <torvalds@...l.org> wrote:

> > Mark the bit reversal functions as being const as they always return the
> > same output for any given input.
> 
> Well, we should mark the argument const too, no?

The argument is just an integer; I'm not sure that marking it const actually
achieves anything, except to tell the function that it can't modify it - and
since it's effectively a copy, where's the fun in that.

> Does anythign actually improve from this? Also, we should actually use 
> "__attribute_const__" instead (which works with other compilers), not the 
> gcc'ism. That "__attribute__((const))" thing is a horrible syntax anyway 
> (and has apparently slipped into <linux/log2.h> too - Damn.

Ah.  I thought that was just for supporting old versions of gcc.  I didn't
realise it was for handling strange compilers.

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