This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Exact meaning of __attribute__(__const__)
- To: "Matthias Clasen" <matthiasc at poet dot de>
- Subject: Re: Exact meaning of __attribute__(__const__)
- From: Florian Weimer <fw at deneb dot enyo dot de>
- Date: Fri, 05 Oct 2001 10:57:26 +0200
- Cc: <gcc-help at gcc dot gnu dot org>
- References: <07c801c14d76$0ec13fb0$740ba8c0@poet.de>
"Matthias Clasen" <matthiasc@poet.de> writes:
> The gcc manual states that const functions may not read global
> memory.
>
> Is it really that strict or is it permittable for a const function
> to read global memory which doesn't change over time (which I've
> heard) ?
I'd be surprised if const functions are even permitted to change
global memory. Otherwise, you couldn't implement memoizing.