function attribute const
Tony Finch
dot@dotat.at
Wed Mar 13 06:45:00 GMT 2002
On Wed, Mar 13, 2002 at 03:38:36PM +0100, Jan Hubicka wrote:
> >
> > 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.
I can make sure that a valid pointer implies that what is pointed to has
been initialized.
Tony.
More information about the Gcc
mailing list