1
0
Fork 0
mirror of https://github.com/tobast/libunwind-eh_elf.git synced 2024-12-23 03:53:43 +01:00

Annotate unused parameters in tests

Compiling the tests with -Wextra results to lots of warnings for unused
parameters. Annotate these cases with the `unused' attribute to avoid
the warnings.
This commit is contained in:
Tommi Rantala 2012-08-02 09:42:21 +03:00
parent 47a99b6f00
commit f42a8de0fa
16 changed files with 55 additions and 36 deletions

View file

@ -123,7 +123,7 @@ do_backtrace (void)
}
void
foo (long val)
foo (long val __attribute__((unused)))
{
do_backtrace ();
}
@ -160,7 +160,7 @@ bar (long v)
}
void
sighandler (int signal, void *siginfo, void *context)
sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
{
ucontext_t *uc = context;
int sp;
@ -200,7 +200,7 @@ sighandler (int signal, void *siginfo, void *context)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
struct sigaction act;
stack_t stk;

View file

@ -46,7 +46,7 @@ int got_usr1, got_usr2;
char *sigusr1_sp;
void
handler (int sig)
handler (int sig __attribute__((unused)))
{
unw_word_t ip;
unw_context_t uc;
@ -68,7 +68,7 @@ handler (int sig)
}
void *
worker (void *arg)
worker (void *arg __attribute__((unused)))
{
signal (SIGUSR1, handler);
@ -102,7 +102,7 @@ doit (void)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
if (argc > 1)
verbose = 1;

View file

@ -157,13 +157,13 @@ sighandler (int signal)
}
int
dev_null (const char *format, ...)
dev_null (const char *format __attribute__((unused)), ...)
{
return 0;
}
int
main (int argc, char *argv[])
main (int argc, char *argv[] __attribute__((unused)))
{
unw_dyn_region_info_t *region;
unw_dyn_info_t di;

View file

@ -99,7 +99,7 @@ Test_Class::Test_Class (void)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
verbose = argc > 1;
return atexit (a);

View file

@ -127,7 +127,7 @@ handler (int sig)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
float d = 1.0;
int n = 0;

View file

@ -137,7 +137,7 @@ do_backtrace (void)
}
void
foo (long val)
foo (long val __attribute__((unused)))
{
do_backtrace ();
}
@ -174,7 +174,7 @@ bar (long v)
}
void
sighandler (int signal, void *siginfo, void *context)
sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
{
ucontext_t *uc = context;
int sp;
@ -216,7 +216,7 @@ sighandler (int signal, void *siginfo, void *context)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
struct sigaction act;
stack_t stk;

View file

@ -1331,7 +1331,7 @@ foo_128 (void)
}
void *
bar(void *p)
bar(void *p __attribute__((unused)))
{
int i;
for (i = 0; i < ITERS; ++i) {
@ -1485,7 +1485,7 @@ int doit ()
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
if (argc > 1)
verbose = 1;

View file

@ -158,7 +158,7 @@ sighandler (int signal)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
struct sigaction act;
long i = 0;

View file

@ -261,7 +261,7 @@ static void install_sigsegv_handler(void)
}
int
main(int argc, char **argv)
main(int argc __attribute__((unused)), char **argv)
{
unw_addr_space_t as;
struct UCD_info *ui;

View file

@ -91,7 +91,7 @@ foo (void)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
verbose = (argc > 1);

View file

@ -82,7 +82,7 @@ consume_some_stack_space (void)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
struct rlimit rlim;

View file

@ -43,15 +43,20 @@ int errors;
{ ++errors; fprintf (stderr, args); return -1; }
static int
find_proc_info (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pip,
int need_unwind_info, void *arg)
find_proc_info (unw_addr_space_t as __attribute__((unused)),
unw_word_t ip __attribute__((unused)),
unw_proc_info_t *pip __attribute__((unused)),
int need_unwind_info __attribute__((unused)),
void *arg __attribute__((unused)))
{
return -UNW_ESTOPUNWIND;
}
static int
access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *valp,
int write, void *arg)
access_mem (unw_addr_space_t as __attribute__((unused)),
unw_word_t addr __attribute__((unused)),
unw_word_t *valp, int write,
void *arg __attribute__((unused)))
{
if (!write)
*valp = 0;
@ -59,8 +64,10 @@ access_mem (unw_addr_space_t as, unw_word_t addr, unw_word_t *valp,
}
static int
access_reg (unw_addr_space_t as, unw_regnum_t regnum, unw_word_t *valp,
int write, void *arg)
access_reg (unw_addr_space_t as __attribute__((unused)),
unw_regnum_t regnum __attribute__((unused)),
unw_word_t *valp, int write,
void *arg __attribute__((unused)))
{
if (!write)
*valp = 32;
@ -68,8 +75,10 @@ access_reg (unw_addr_space_t as, unw_regnum_t regnum, unw_word_t *valp,
}
static int
access_fpreg (unw_addr_space_t as, unw_regnum_t regnum, unw_fpreg_t *valp,
int write, void *arg)
access_fpreg (unw_addr_space_t as __attribute__((unused)),
unw_regnum_t regnum __attribute__((unused)),
unw_fpreg_t *valp, int write,
void *arg __attribute__((unused)))
{
if (!write)
memset (valp, 0, sizeof (*valp));
@ -77,27 +86,37 @@ access_fpreg (unw_addr_space_t as, unw_regnum_t regnum, unw_fpreg_t *valp,
}
static int
get_dyn_info_list_addr (unw_addr_space_t as, unw_word_t *dilap, void *arg)
get_dyn_info_list_addr (unw_addr_space_t as __attribute__((unused)),
unw_word_t *dilap __attribute__((unused)),
void *arg __attribute__((unused)))
{
return -UNW_ENOINFO;
}
static void
put_unwind_info (unw_addr_space_t as, unw_proc_info_t *pi, void *arg)
put_unwind_info (unw_addr_space_t as __attribute__((unused)),
unw_proc_info_t *pi __attribute__((unused)),
void *arg __attribute__((unused)))
{
++errors;
fprintf (stderr, "%s() got called!\n", __FUNCTION__);
}
static int
resume (unw_addr_space_t as, unw_cursor_t *reg, void *arg)
resume (unw_addr_space_t as __attribute__((unused)),
unw_cursor_t *reg __attribute__((unused)),
void *arg __attribute__((unused)))
{
panic ("%s() got called!\n", __FUNCTION__);
}
static int
get_proc_name (unw_addr_space_t as, unw_word_t ip, char *buf, size_t buf_len,
unw_word_t *offp, void *arg)
get_proc_name (unw_addr_space_t as __attribute__((unused)),
unw_word_t ip __attribute__((unused)),
char *buf __attribute__((unused)),
size_t buf_len __attribute__((unused)),
unw_word_t *offp __attribute__((unused)),
void *arg __attribute__((unused)))
{
panic ("%s() got called!\n", __FUNCTION__);
}

View file

@ -104,7 +104,7 @@ bar (int v)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
int val = argc;

View file

@ -139,7 +139,7 @@ sighandler (int signal)
}
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
volatile sigset_t sigset1, sigset2, sigset3;
volatile struct sigaction act;

View file

@ -87,7 +87,7 @@ test_local (void)
#endif /* !UNW_REMOTE_ONLY */
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
if (argc > 1)
verbose = 1;

View file

@ -2,7 +2,7 @@
#include <stdio.h>
int
main (int argc, char **argv)
main (int argc, char **argv __attribute__((unused)))
{
int i, verbose = argc > 1;
const char *msg;