This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Functions that always return
- To: Geert Bosch <bosch at gnat dot com>
- Subject: Re: Functions that always return
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sun, 29 Oct 2000 08:53:59 -0800
- Cc: Michael Hayes <mhayes at redhat dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- References: <20001029161942.064A934D83@nile.gnat.com>
On Sun, Oct 29, 2000 at 11:19:45AM -0400, Geert Bosch wrote:
> Even a pure or const function is not guaranteed to return.
> Any function can raise an exception (as in C++/Ada) and
> in particular a stack-check may fail at any time.
At least for C++ we don't mark functions constant if they can
raise exceptions. And there are no stack checks to worry about.
So unless you don't mind getting a division-by-zero or memory
fault or whatever instead of your function's exception, you'd
better not be marking these a const in Ada.
r~