This is the mail archive of the gcc-patches@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] |
Other format: | [Raw text] |
Where do you handle the following situation? :
int foo(int i) { static int s = 0; if (bar(i)) s = 1; return s; }
Assume that bar() is a function which calls foo() (which is then indirectly recursive), in this way:
int bar(int i) { if (i) { foo(i-1); return 0; } return 1; }
An outer call to foo(1) needs to return 1, not 0.
Cheers Nick
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |