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);
32 #endif /* ! vxworks */
35 * The following functions do nothing useful. They are included simply
36 * as places to try setting breakpoints at. They are explicitly
37 * "one-line functions" to verify that this case works (some versions
38 * of gcc have or have had problems with this).
41 int marker1 () { return (0); }
42 int marker2 (a
) int a
; { return (1); }
43 void marker3 (a
, b
) char *a
, *b
; {}
44 void marker4 (d
) long d
; {}
47 * This simple classical example of recursion is useful for
48 * testing stack backtraces and such.
52 main (argc
, argv
, envp
)
57 fprintf (stderr
, "usage: factorial <number>\n");
60 printf ("%d\n", factorial (atoi (argv
[1])));
64 marker3 ("stack", "trace");
73 value
*= factorial (value
- 1);
This page took 0.03085 seconds and 4 git commands to generate.