Use `UNUSED' in tests
diff --git a/tests/Gtest-bt.c b/tests/Gtest-bt.c
index 4a07c6f..802dd08 100644
--- a/tests/Gtest-bt.c
+++ b/tests/Gtest-bt.c
@@ -127,7 +127,7 @@
}
void
-foo (long val __attribute__((unused)))
+foo (long val UNUSED)
{
do_backtrace ();
}
@@ -164,7 +164,7 @@
}
void
-sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
+sighandler (int signal, void *siginfo UNUSED, void *context)
{
ucontext_t *uc UNUSED;
int sp;
@@ -206,7 +206,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction act;
stack_t stk;
diff --git a/tests/Gtest-concurrent.c b/tests/Gtest-concurrent.c
index b98b6c0..6f3447f 100644
--- a/tests/Gtest-concurrent.c
+++ b/tests/Gtest-concurrent.c
@@ -27,6 +27,8 @@
# include "config.h"
#endif
+#include "compiler.h"
+
#include <libunwind.h>
#include <limits.h>
#include <pthread.h>
@@ -46,7 +48,7 @@
char *sigusr1_sp;
void
-handler (int sig __attribute__((unused)))
+handler (int sig UNUSED)
{
unw_word_t ip;
unw_context_t uc;
@@ -68,7 +70,7 @@
}
void *
-worker (void *arg __attribute__((unused)))
+worker (void *arg UNUSED)
{
signal (SIGUSR1, handler);
@@ -102,7 +104,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/Gtest-dyn1.c b/tests/Gtest-dyn1.c
index 96eb706..bc7dc9c 100644
--- a/tests/Gtest-dyn1.c
+++ b/tests/Gtest-dyn1.c
@@ -27,6 +27,8 @@
#include "flush-cache.h"
+#include "compiler.h"
+
#include <libunwind.h>
#include <stdio.h>
#include <stdlib.h>
@@ -157,13 +159,13 @@
}
int
-dev_null (const char *format __attribute__((unused)), ...)
+dev_null (const char *format UNUSED, ...)
{
return 0;
}
int
-main (int argc, char *argv[] __attribute__((unused)))
+main (int argc, char *argv[] UNUSED)
{
unw_dyn_region_info_t *region;
unw_dyn_info_t di;
diff --git a/tests/Gtest-init.cxx b/tests/Gtest-init.cxx
index 9a3f482..afded01 100644
--- a/tests/Gtest-init.cxx
+++ b/tests/Gtest-init.cxx
@@ -31,6 +31,7 @@
#include <unistd.h>
#include <libunwind.h>
+#include "compiler.h"
int verbose, errors;
@@ -99,7 +100,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
verbose = argc > 1;
return atexit (a);
diff --git a/tests/Gtest-resume-sig.c b/tests/Gtest-resume-sig.c
index 57939cd..55eb00a 100644
--- a/tests/Gtest-resume-sig.c
+++ b/tests/Gtest-resume-sig.c
@@ -27,6 +27,8 @@
# include "config.h"
#endif
+#include "compiler.h"
+
#include <libunwind.h>
#include <signal.h>
#include <stdio.h>
@@ -64,8 +66,8 @@
#ifdef TEST_WITH_SIGINFO
void
handler (int sig,
- siginfo_t *si __attribute__((unused)),
- void *ucontext __attribute__((unused)))
+ siginfo_t *si UNUSED,
+ void *ucontext UNUSED)
#else
void
handler (int sig)
@@ -135,7 +137,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction sa;
float d = 1.0;
diff --git a/tests/Gtest-trace.c b/tests/Gtest-trace.c
index e8dd989..dcd467b 100644
--- a/tests/Gtest-trace.c
+++ b/tests/Gtest-trace.c
@@ -139,7 +139,7 @@
}
void
-foo (long val __attribute__((unused)))
+foo (long val UNUSED)
{
do_backtrace ();
}
@@ -176,7 +176,7 @@
}
void
-sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
+sighandler (int signal, void *siginfo UNUSED, void *context)
{
ucontext_t *uc UNUSED;
int sp;
@@ -220,7 +220,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction act;
stack_t stk;
diff --git a/tests/Lrs-race.c b/tests/Lrs-race.c
index 061bd8c..e39a62b 100644
--- a/tests/Lrs-race.c
+++ b/tests/Lrs-race.c
@@ -26,6 +26,7 @@
#define UNW_LOCAL_ONLY
#include <libunwind.h>
+#include "compiler.h"
#include <stdio.h>
#include <pthread.h>
@@ -1333,7 +1334,7 @@
}
void *
-bar(void *p __attribute__((unused)))
+bar(void *p UNUSED)
{
int i;
for (i = 0; i < ITERS; ++i) {
@@ -1487,7 +1488,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/Ltest-varargs.c b/tests/Ltest-varargs.c
index dd12c86..17ac600 100644
--- a/tests/Ltest-varargs.c
+++ b/tests/Ltest-varargs.c
@@ -64,7 +64,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/test-async-sig.c b/tests/test-async-sig.c
index 9a0d39e..2ce8b4b 100644
--- a/tests/test-async-sig.c
+++ b/tests/test-async-sig.c
@@ -27,6 +27,8 @@
#include "config.h"
#endif
+#include "compiler.h"
+
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -159,7 +161,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction act;
long i = 0;
diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
index d7c7954..5254708 100644
--- a/tests/test-coredump-unwind.c
+++ b/tests/test-coredump-unwind.c
@@ -263,7 +263,7 @@
}
int
-main(int argc __attribute__((unused)), char **argv)
+main(int argc UNUSED, char **argv)
{
unw_addr_space_t as;
struct UCD_info *ui;
diff --git a/tests/test-init-remote.c b/tests/test-init-remote.c
index 47d9548..66f2d6a 100644
--- a/tests/test-init-remote.c
+++ b/tests/test-init-remote.c
@@ -32,6 +32,8 @@
# include "config.h"
#endif
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -91,7 +93,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
verbose = (argc > 1);
diff --git a/tests/test-mem.c b/tests/test-mem.c
index 2a24359..52c9774 100644
--- a/tests/test-mem.c
+++ b/tests/test-mem.c
@@ -25,6 +25,8 @@
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+#include "compiler.h"
+
#include <libunwind.h>
#include <stdio.h>
#include <stdlib.h>
@@ -82,7 +84,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct rlimit rlim;
diff --git a/tests/test-proc-info.c b/tests/test-proc-info.c
index e97ef2b..c4145bc 100644
--- a/tests/test-proc-info.c
+++ b/tests/test-proc-info.c
@@ -36,6 +36,7 @@
#include <string.h>
#include <libunwind.h>
+#include "compiler.h"
int errors;
@@ -43,20 +44,20 @@
{ ++errors; fprintf (stderr, args); return -1; }
static int
-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)))
+find_proc_info (unw_addr_space_t as UNUSED,
+ unw_word_t ip UNUSED,
+ unw_proc_info_t *pip UNUSED,
+ int need_unwind_info UNUSED,
+ void *arg UNUSED)
{
return -UNW_ESTOPUNWIND;
}
static int
-access_mem (unw_addr_space_t as __attribute__((unused)),
- unw_word_t addr __attribute__((unused)),
+access_mem (unw_addr_space_t as UNUSED,
+ unw_word_t addr UNUSED,
unw_word_t *valp, int write,
- void *arg __attribute__((unused)))
+ void *arg UNUSED)
{
if (!write)
*valp = 0;
@@ -64,10 +65,10 @@
}
static int
-access_reg (unw_addr_space_t as __attribute__((unused)),
- unw_regnum_t regnum __attribute__((unused)),
+access_reg (unw_addr_space_t as UNUSED,
+ unw_regnum_t regnum UNUSED,
unw_word_t *valp, int write,
- void *arg __attribute__((unused)))
+ void *arg UNUSED)
{
if (!write)
*valp = 32;
@@ -75,10 +76,10 @@
}
static int
-access_fpreg (unw_addr_space_t as __attribute__((unused)),
- unw_regnum_t regnum __attribute__((unused)),
+access_fpreg (unw_addr_space_t as UNUSED,
+ unw_regnum_t regnum UNUSED,
unw_fpreg_t *valp, int write,
- void *arg __attribute__((unused)))
+ void *arg UNUSED)
{
if (!write)
memset (valp, 0, sizeof (*valp));
@@ -86,37 +87,37 @@
}
static int
-get_dyn_info_list_addr (unw_addr_space_t as __attribute__((unused)),
- unw_word_t *dilap __attribute__((unused)),
- void *arg __attribute__((unused)))
+get_dyn_info_list_addr (unw_addr_space_t as UNUSED,
+ unw_word_t *dilap UNUSED,
+ void *arg UNUSED)
{
return -UNW_ENOINFO;
}
static void
-put_unwind_info (unw_addr_space_t as __attribute__((unused)),
- unw_proc_info_t *pi __attribute__((unused)),
- void *arg __attribute__((unused)))
+put_unwind_info (unw_addr_space_t as UNUSED,
+ unw_proc_info_t *pi UNUSED,
+ void *arg UNUSED)
{
++errors;
fprintf (stderr, "%s() got called!\n", __FUNCTION__);
}
static int
-resume (unw_addr_space_t as __attribute__((unused)),
- unw_cursor_t *reg __attribute__((unused)),
- void *arg __attribute__((unused)))
+resume (unw_addr_space_t as UNUSED,
+ unw_cursor_t *reg UNUSED,
+ void *arg UNUSED)
{
panic ("%s() got called!\n", __FUNCTION__);
}
static int
-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)))
+get_proc_name (unw_addr_space_t as UNUSED,
+ unw_word_t ip UNUSED,
+ char *buf UNUSED,
+ size_t buf_len UNUSED,
+ unw_word_t *offp UNUSED,
+ void *arg UNUSED)
{
panic ("%s() got called!\n", __FUNCTION__);
}
diff --git a/tests/test-ptrace-misc.c b/tests/test-ptrace-misc.c
index fbbec9c..374059d 100644
--- a/tests/test-ptrace-misc.c
+++ b/tests/test-ptrace-misc.c
@@ -23,6 +23,8 @@
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+#include "compiler.h"
+
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
@@ -104,7 +106,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
int val = argc;
diff --git a/tests/test-setjmp.c b/tests/test-setjmp.c
index 3054574..769b71b 100644
--- a/tests/test-setjmp.c
+++ b/tests/test-setjmp.c
@@ -23,6 +23,8 @@
/* The setjmp()/longjmp(), sigsetjmp()/siglongjmp(). */
+#include "compiler.h"
+
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
@@ -139,7 +141,7 @@
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
volatile sigset_t sigset1, sigset2, sigset3;
volatile struct sigaction act;
diff --git a/tests/test-static-link-loc.c b/tests/test-static-link-loc.c
index ed94f55..4e47e45 100644
--- a/tests/test-static-link-loc.c
+++ b/tests/test-static-link-loc.c
@@ -33,6 +33,7 @@
#define UNW_LOCAL_ONLY
#include <libunwind.h>
+#include "compiler.h"
extern int test_generic (void);
@@ -87,7 +88,7 @@
#endif /* !UNW_REMOTE_ONLY */
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/test-strerror.c b/tests/test-strerror.c
index 4470952..f7ae61e 100644
--- a/tests/test-strerror.c
+++ b/tests/test-strerror.c
@@ -1,8 +1,9 @@
+#include "compiler.h"
#include <libunwind.h>
#include <stdio.h>
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
int i, verbose = argc > 1;
const char *msg;