function attribute const

Alexandre Oliva aoliva@redhat.com
Wed Mar 13 13:36:00 GMT 2002


On Mar 13, 2002, Tony Finch <dot@dotat.at> wrote:

> On Wed, Mar 13, 2002 at 05:03:28PM -0300, Alexandre Oliva wrote:
>> 
>> But you also have to make sure the compiler won't move the
>> initialization past the call of the const function.

> It can't do that if the pointer was originally obtained from a function
> that did the allocation and initialization, or if it was passed in as
> an argument after being initialized.

That's not enough of you take inlining into account.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer



More information about the Gcc mailing list