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: Fergus Henderson <fjh at cs dot mu dot oz dot au>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Mar 2002 18:11:06 +1100
- Subject: Re: [RFC]: patch to detect invalid and missing ATTRIBUTE const/pure
- References: <200203230518.AAA20893@caip.rutgers.edu>
On 23-Mar-2002, Kaveh R. Ghazi <ghazi@caip.rutgers.edu> wrote:
> > Some other observations:
> >
> > 1) If the function was marked by the programmer, then you probably don't
> > want to issue warnings about the function being invalid for const
> > or pure just because a loop is present. The programmer may know
> > that the loop always terminates. However, it is useful to issue
> > a warning if the function writes to global memory.
>
> Can similar reasoning be applied to otherwise const/pure functions
> which in pathological cases call noreturn functions?
IMHO: yes.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.