This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc-3.0: Obvious infinite recursion not detected


<<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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]