~vcs-imports-ii/libsigsegv/master

« back to all changes in this revision

Viewing changes to tests/test-catch-stackoverflow1.c

  • Committer: Bruno Haible
  • Date: 2021-08-07 13:45:14 UTC
  • Revision ID: git-v1:c8e9f20635b1631f139dd63a70d4ad842f61af35
tests: Silence some GCC warnings.

Patch by Paul Eggert.

* tests/test-catch-segv1.c, tests/test-catch-stackoverflow1.c,
tests/test-catch-stackoverflow2.c: Declare some functions and variables
static, to pacify GCC when warning about external functions missing
declarations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
#endif
44
44
#include "altstack-util.h"
45
45
 
46
 
jmp_buf mainloop;
47
 
sigset_t mainsigset;
48
 
 
49
 
volatile int pass = 0;
50
 
 
51
 
volatile char *stack_lower_bound;
52
 
volatile char *stack_upper_bound;
 
46
static jmp_buf mainloop;
 
47
static sigset_t mainsigset;
 
48
 
 
49
static volatile int pass = 0;
 
50
 
 
51
static volatile char *stack_lower_bound;
 
52
static volatile char *stack_upper_bound;
53
53
 
54
54
static void
55
55
stackoverflow_handler_continuation (void *arg1, void *arg2, void *arg3)
58
58
  longjmp (mainloop, arg);
59
59
}
60
60
 
61
 
void
 
61
static void
62
62
stackoverflow_handler (int emergency, stackoverflow_context_t scp)
63
63
{
64
64
  char dummy;
72
72
                         (void *) (long) (emergency ? -1 : pass), NULL, NULL);
73
73
}
74
74
 
75
 
volatile int *
 
75
static volatile int *
76
76
recurse_1 (int n, volatile int *p)
77
77
{
78
78
  if (n < INT_MAX)
80
80
  return p;
81
81
}
82
82
 
83
 
int
 
83
static int
84
84
recurse (volatile int n)
85
85
{
86
86
  return *recurse_1 (n, &n);