From: William Lee Irwin III <wli@holomorphy.com>
To: Nikita Danilov <Nikita@Namesys.COM>
Cc: Gianni Tedesco <gianni@scaramanga.co.uk>,
Linux Kernel Mailing List <Linux-Kernel@Vger.Kernel.ORG>,
Linus Torvalds <Torvalds@Transmeta.COM>,
Andrew Morton <AKPM@Digeo.COM>
Subject: Re: const from include/asm-i386/byteorder.h
Date: Mon, 2 Jun 2003 05:14:57 -0700 [thread overview]
Message-ID: <20030602121457.GO8978@holomorphy.com> (raw)
In-Reply-To: <16091.14923.815819.792026@laputa.namesys.com>
On Mon, Jun 02, 2003 at 03:51:39PM +0400, Nikita Danilov wrote:
> Gcc info page:
> `const'
> Many functions do not examine any values except their arguments,
> and have no effects except the return value. Basically this is
> just slightly more strict class than the `pure' attribute above,
> since function is not allowed to read global memory.
> So, it seems byte swapping functions should be __attribute__((const))
> Here is a patch:
I'm very skeptical, in particular, about these hunks:
On Mon, Jun 02, 2003 at 03:51:39PM +0400, Nikita Danilov wrote:
> #include <linux/thread_info.h>
> -static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
> +static inline struct task_struct *get_current(void) __attribute_const;
> static inline struct task_struct *get_current(void)
> {
> ===== include/asm-arm/thread_info.h 1.6 vs edited =====
> --- 1.6/include/asm-arm/thread_info.h Sat Dec 28 19:26:45 2002
> +++ edited/include/asm-arm/thread_info.h Mon Jun 2 14:44:24 2003
> @@ -74,7 +74,7 @@
> /*
> * how to get the thread information struct from C
> */
> -static inline struct thread_info *current_thread_info(void) __attribute__ (( __const__ ));
> +static inline struct thread_info *current_thread_info(void) __attribute_const;
>
> static inline struct thread_info *current_thread_info(void)
> {
Someone needs to doublecheck whether this actually works. Last I heard,
it did not, but that could have changed since. It vaguely appears some
assumption about it working was made recently since __const__ was there.
-- wli
next prev parent reply other threads:[~2003-06-02 12:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-31 14:10 const from include/asm-i386/byteorder.h Nikita Danilov
2003-05-31 18:49 ` Gianni Tedesco
2003-05-31 18:57 ` William Lee Irwin III
2003-06-02 11:51 ` Nikita Danilov
2003-06-02 12:14 ` William Lee Irwin III [this message]
2003-06-02 12:36 ` Nikita Danilov
2003-06-02 12:40 ` William Lee Irwin III
2003-06-02 12:59 ` Nikita Danilov
2003-06-02 13:08 ` William Lee Irwin III
2003-06-02 13:21 ` Gianni Tedesco
2003-06-02 13:37 ` Adrian Bunk
2003-06-02 14:46 ` Nikita Danilov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030602121457.GO8978@holomorphy.com \
--to=wli@holomorphy.com \
--cc=AKPM@Digeo.COM \
--cc=Linux-Kernel@Vger.Kernel.ORG \
--cc=Nikita@Namesys.COM \
--cc=Torvalds@Transmeta.COM \
--cc=gianni@scaramanga.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.