Functions that always return

Richard Henderson rth@cygnus.com
Sun Oct 29 08:54:00 GMT 2000


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~


More information about the Gcc mailing list