This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: function attribute const
- From: Jan Hubicka <jh at suse dot cz>
- To: Tony Finch <dot at dotat dot at>
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 13 Mar 2002 15:38:36 +0100
- Subject: Re: function attribute const
- References: <20020313142936.B12067@chiark.greenend.org.uk>
> The gcc info page says
>
> Note that a function that has pointer arguments and examines the
> data pointed to must _not_ be declared `const'.
>
> If the programmer knows that the data structures which a function
> examines will not change from one invocation of the function to
> another, why can't the function be declared const?
Compiler may want to move the function call around and may get it before
the structure is initialized.
Honza
>
> Tony.