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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 1 May 2007 23:52:37 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Rusty Russell <rusty@...tcorp.com.au>, linux-kernel@...r.kernel.org
Subject: Re: [patch 01/10] compiler: define __attribute_unused__

On Tue, 1 May 2007 23:41:34 -0700 (PDT) David Rientjes <rientjes@...gle.com> wrote:

> compiler: define __maybe_unused
> 
> Define __maybe_unused to apply to both functions or variables as
> __attribute__((unused)).  This will not emit a compile-time warning when
> a function or variable is declared but unreferenced.
> 
> We eventually want to change the name of __attribute_used__ to __used.
> 
> Signed-off-by: David Rientjes <rientjes@...gle.com>
> ---
>  include/linux/compiler-gcc.h |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
> --- a/include/linux/compiler-gcc.h
> +++ b/include/linux/compiler-gcc.h
> @@ -37,3 +37,4 @@
>  #define  noinline			__attribute__((noinline))
>  #define __attribute_pure__		__attribute__((pure))
>  #define __attribute_const__		__attribute__((__const__))
> +#define __maybe_unused			__attribute__((unused))

Seems sane to me.  We'd need a definition in compiler-intel.h too.  I don't
know if ICC implements __attribute__((unused)) - probably it does.

I guess we can get by without any commentary describing __maybe_unused, but
I think __used would need one - it's pretty obscure.


+@...dex @code{used} attribute.
+@...m used
+This attribute, attached to a function, means that code must be emitted
+for the function even if it appears that the function is not referenced.
+This is useful, for example, when the function is referenced only in
+inline assembly.

-
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