This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-3.0: Obvious infinite recursion not detected
- To: aoliva at redhat dot com, fjh at cs dot mu dot oz dot au
- Subject: Re: gcc-3.0: Obvious infinite recursion not detected
- From: dewar at gnat dot com
- Date: Thu, 5 Jul 2001 11:29:18 -0400 (EDT)
- Cc: Ryszard dot Kabatek at softax dot pl, gcc at gcc dot gnu dot org
<<For the Mercury compiler, the conditions are that all of the following hold:
- the call is to the same procedure that the call occurs in
- the input arguments in the call are the same as the input parameters
for the calling procedure
>>
GNAT has a similar warning, most useful in cases like:
(an attempt at defining a saturated add)
1. procedure f is
2.
3. function "+" (a,b : integer) return integer is
4. begin
5. return a + b;
|
>>> warning: possible infinite recursion
>>> warning: Storage_Error may be raised at run time
6. exception
7. when constraint_error =>
8. return integer'last;
9. end "+";
10.
11. begin
12. null;
13. end;