aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/run.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/run.c')
-rw-r--r--gdb/testsuite/gdb.base/run.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.base/run.c b/gdb/testsuite/gdb.base/run.c
index 40ec720..25b8a4a 100644
--- a/gdb/testsuite/gdb.base/run.c
+++ b/gdb/testsuite/gdb.base/run.c
@@ -34,11 +34,20 @@ char *arg;
#else /* ! vxworks */
# include <stdio.h>
+# include <stdlib.h>
#endif /* ! vxworks */
+#ifdef PROTOTYPES
+int factorial (int);
+
+int
+main (int argc, char **argv, char **envp)
+#else
+int
main (argc, argv, envp)
int argc;
char *argv[], **envp;
+#endif
{
#ifdef usestubs
set_debug_traps();
@@ -57,11 +66,17 @@ char *argv[], **envp;
return 0;
}
-int factorial (value)
-int value;
+#ifdef PROTOTYPES
+int factorial (int value)
+#else
+int factorial (value) int value;
+#endif
{
+ int local_var;
+
if (value > 1) {
value *= factorial (value - 1);
}
+ local_var = value;
return (value);
}