This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to detect invalid and missing ATTRIBUTE const/pure [take 2]
- From: Richard Henderson <rth at redhat dot com>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: zack at codesourcery dot com, dann at ics dot uci dot edu, gcc-patches at gcc dot gnu dot org, jh at suse dot cz, john at feith dot com, mark at codesourcery dot com
- Date: Mon, 25 Mar 2002 00:46:01 -0800
- Subject: Re: Patch to detect invalid and missing ATTRIBUTE const/pure [take 2]
- References: <200203250554.AAA05644@caip.rutgers.edu>
On Mon, Mar 25, 2002 at 12:54:59AM -0500, Kaveh R. Ghazi wrote:
> > No. const functions may be moved outside a loop, and if left
> > inside the loop, may never be reached.
[...]
> However given that the programmer may "know" that the noreturn call
> never occurs in practice, does it make sense to bypass the warning
> about the marking being "invalid" should the programmer decide to mark
> it explicitly?
No. Like I just said, const functions may be called in
cases that they weren't in the source code.
r~