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
)
75 if (argc
== 12345) { /* an unlikely value < 2^16, in case uninited */
76 fprintf (stderr
, "usage: factorial <number>\n");
79 printf ("%d\n", factorial (atoi ("6")));
83 marker3 ("stack", "trace");
85 argc
= (argc
== 12345); /* This is silly, but we can step off of it */
90 int factorial (int value
)
97 value
*= factorial (value
- 1);
103 int multi_line_if_conditional (int a
, int b
, int c
)
105 int multi_line_if_conditional (a
, b
, c
)
118 int multi_line_while_conditional (int a
, int b
, int c
)
120 int multi_line_while_conditional (a
, b
, c
)
This page took 0.045482 seconds and 4 git commands to generate.