/* ** Some examples for testing tail-call optimizaton in GCC */ int fact (int n) { return (n > 0 ? n * fact (n-1) : 1) ; } int fact2 (int n, int res) { return (n > 0 ? fact2 (n-1, n * res) : res) ; } int isEvn (int x) { return (x > 0 ? isOdd (x-1) : 1) ; } int isOdd (int x) { return (x > 0 ? isEvn (x-1) : 0) ; } /* end of [tailcall.c] */