This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC]: patch to detect invalid and missing ATTRIBUTE const/pure
- From: Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>
- To: Dan Nicolaescu <dann at godzilla dot ICS dot UCI dot EDU>
- Cc: Jakub Jelinek <jakub at redhat dot com>, "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, john at feith dot com, gcc-patches at gcc dot gnu dot org, jh at suse dot cz, mark at codesourcery dot com, rth at redhat dot com
- Date: Fri, 22 Mar 2002 19:59:09 +0100
- Subject: Re: [RFC]: patch to detect invalid and missing ATTRIBUTE const/pure
jakub@redhat.com said:
> Only if foo is static or MODULE_LOCAL_P. Otherwise anyone can
> interpose a different version of foo which is not pure.
A dirty stupid idea from a guy doing too much C++...
Why not mangle the names of pure/const functions, so that they can only be
overriden by other pure/const functions. At least there would be (clear!)
linker messages and the optimization made possible by the attributes
would always apply (disregarding static, ...).
Theo.
--------------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
--------------------------------------------------------------------