5 /* VxWorks does not supply atoi. */
12 while (*z >= '0' && *z <= '9')
13 i = i * 10 + (*z++ - '0');
17 /* I don't know of any way to pass an array to VxWorks. This function
18 can be called directly from gdb. */
27 main (2, argv, (char **) 0);
33 #endif /* ! vxworks */
36 * The following functions do nothing useful. They are included simply
37 * as places to try setting breakpoints at. They are explicitly
38 * "one-line functions" to verify that this case works (some versions
39 * of gcc have or have had problems with this).
43 int marker1 (void) { return (0); }
44 int marker2 (int a) { return (1); }
45 void marker3 (char *a, char *b) {}
46 void marker4 (long d) {}
48 int marker1 () { return (0); }
49 int marker2 (a) int a; { return (1); }
50 void marker3 (a, b) char *a, *b; {}
51 void marker4 (d) long d; {}
55 * This simple classical example of recursion is useful for
56 * testing stack backtraces and such.
63 main (int argc, char **argv, char **envp)
66 main (argc, argv, envp)
76 fprintf (stderr, "usage: factorial <number>\n");
79 printf ("%d\n", factorial (atoi ("6")));
83 marker3 ("stack", "trace");
89 int factorial (int value)
96 value *= factorial (value - 1);